You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-10Lines changed: 26 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Spendee
1
+
# Spendee Python Client
2
2
3
3
This is a Python client for interfacing with the wonderful [Spendee app](https://www.spendee.com/).
4
4
@@ -7,11 +7,13 @@ The codebase was forked from [dionysio/spendee](https://github.com/dionysio/spen
7
7
About Spendee:
8
8
> Spendee.com is a budget and expense tracker application to manage personal finances. It allows users to connect bank accounts, e-wallets, and crypto wallets to get an aggregated overview of their financial situation. The app helps users organize and analyze spending through automatic transaction categorization, visually appealing graphs, and insights.
9
9
10
-
# Warning
10
+
## ⚠️ Warning
11
11
12
-
No guarantees are provided here. If you wanna use it, go for it, but do know that the original API is undocumented and while it works at the time of writing, it might stop at any time. I'm not associated with Spendee in any way.
12
+
This is a work in progress and is not recommended for general use yet. The original Spendee API is undocumented, and while this client works at the time of writing, it might stop working at any time. The author is not associated with Spendee in any way.
13
13
14
-
## Development setup
14
+
---
15
+
16
+
## For Users
15
17
16
18
To set up a development environment (only linux is documented):
17
19
@@ -28,13 +30,29 @@ To set up a development environment (only linux is documented):
28
30
3. Set credentials in a newly created `.env` file.
29
31
```bash
30
32
echo'EMAIL=<email>'> .env
31
-
echo'PASSWORD=<passwrod'>> .env
33
+
echo'PASSWORD=<password'>> .env
32
34
```
33
35
4. Adapt `run.py`for your experiment and execute.
34
36
35
-
## Backstory and roadmap
37
+
---
38
+
39
+
## For Developers & Contributors
40
+
41
+
### Development Environment Setup
42
+
43
+
This project uses [mise](https://mise.jdx.dev/) to manage the development environment.
44
+
45
+
1. **Install `mise`**: Follow the [official installation instructions](https://mise.jdx.dev/getting-started.html#installing-mise-cli) to install `mise` on your system.
36
46
37
-
As I started to use the forked repo in 2025, the fetched data from the REST API was outdated by multiple days compared to what is visible on connected Bank accounts and the online webpage.
47
+
2. **Activate `mise`**: Activate `mise`in your shell by following the instructions foryour shellin the [official documentation](https://mise.jdx.dev/getting-started.html#activate-mise).
48
+
49
+
3. **Install Tools**: Once `mise` is activated, navigate to the project's root directory and run `mise install` to install the required tools.
50
+
51
+
4. **Follow the User guide** above.
52
+
53
+
### Backstory and Roadmap
54
+
55
+
As the forked repo was started to be used in 2025, the fetched data from the REST API was outdated by multiple days compared to what is visible on connected Bank accounts and the online webpage.
38
56
39
57
In the interim time since the original author implemented the REST API calls in 2020, Spendee most possibly migrated to another architecture. Based on browser debugging the new setup relies on Google firestore.
40
58
@@ -44,8 +62,6 @@ Next step will be to abstract away the most common operations.
44
62
45
63
After that groundwork, the plan is to implement an MCP server enabling AI agent collaboration to have smarter categorization and conversational exploration of spending habits.
46
64
47
-
Until that last milestone this project is not recommended for usage.
48
-
49
-
## Contributing
65
+
### Contributing
50
66
51
67
If you can improve anything in this repo, feel free to add a pull request or add an issue!
This document provides AI coding assistants with essential context for working with the spendee-python-client project.
5
+
6
+
## Development Environment Setup
7
+
This project uses [mise](https://mise.jdx.dev/) to manage the development environment. For detailed instructions on how to set up the environment, please refer to the [environment setup documentation](docs/environment.md).
8
+
9
+
## Secrets Management
10
+
We use Bitwarden for managing secrets. To access secrets, you will need the `BWS_ACCESS_TOKEN` environment variable set. You can then use the `bws` CLI to fetch secrets.
Important: The `agents.md` files are living documentation that should be updated alongside code changes. When implementing modifications:
24
+
25
+
***Update Relevant Agent Files:** Consider which `agents.md` files need updates when making changes. Avoid adding to the root agents.md file and use dedicated directory related agents.md. Only add the the root, when it is really globally applicable, otherwise just reference there.
26
+
***Keep Implementation Details Current:** Ensure commands, file paths, and procedures reflect the current state
27
+
***Maintain Cross-References:** Update links between agent files and documentation
28
+
***File References Only:** Never quote file content in agent files - only reference files by path
29
+
***Consistency:** Ensure terminology and patterns remain consistent across all agent files
This project uses [mise](https://mise.jdx.dev/) to manage the development environment. `mise` is a tool that helps you manage your development tools and environment variables.
4
+
5
+
## Getting Started
6
+
7
+
1.**Install `mise`**: Follow the [official installation instructions](https://mise.jdx.dev/getting-started.html#installing-mise-cli) to install `mise` on your system.
8
+
9
+
2.**Activate `mise`**: Activate `mise` in your shell by following the instructions for your shell in the [official documentation](https://mise.jdx.dev/getting-started.html#activate-mise).
10
+
11
+
3.**Install Tools**: Once `mise` is activated, navigate to the project's root directory and run the following command to install the tools defined in the `.mise.toml` file:
12
+
```bash
13
+
mise install
14
+
```
15
+
16
+
## Tools
17
+
This project uses several tools that are managed by `mise`. For a complete and up-to-date list of these tools, please refer to the `.mise.toml` file in the root of the repository.
MCP (Model Context Protocol) is an open-source standard for connecting AI applications to external systems. Think of it like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect electronic devices, MCP provides a standardized way to connect AI applications to external systems like data sources, tools, and workflows.
5
+
6
+
## Key Concepts
7
+
***Servers:** Expose data and tools to AI applications.
8
+
***Clients:** Connect to MCP servers to access data and tools.
9
+
***Transports:** The underlying communication mechanism between clients and servers.
10
+
11
+
## Authentication and Authorization
12
+
The MCP server in this project uses a simple bearer token authentication mechanism. It does not implement OAuth or any other complex authentication schemes.
13
+
14
+
To authenticate with the server, you must provide a bearer token in the `Authorization` header of your requests. The server expects the token to be the value of the `MCP_TOKEN` environment variable.
15
+
16
+
## MCP Inspector
17
+
The [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) is an interactive developer tool for testing and debugging MCP servers. It allows you to:
18
+
* Inspect available resources, prompts, and tools.
19
+
* Test prompt generation and tool execution.
20
+
* View server logs and notifications.
21
+
22
+
The `inspect2.sh` script in this repository is designed to help you run the MCP Inspector.
23
+
24
+
## Further Reading
25
+
For a deeper understanding of MCP, please refer to the [official documentation](https://modelcontextprotocol.io/docs/getting-started/intro).
26
+
27
+
---
28
+
For implementation details, see `spendee/agents.md`.
This page provides a brief overview of the scripts and the Dockerfile in this repository.
4
+
5
+
## Scripts
6
+
7
+
***`build.sh`**: Builds the Docker image for the MCP server and pushes it to a local registry.
8
+
***`inspect.sh`**: A development script that sets up a Python virtual environment and executes the `spendee_mcp.py` script.
9
+
***`inspect2.sh`**: Manages the MCP inspector tool, including cloning the repository, building the Docker image, and running the container.
10
+
***`run-mcp.sh`**: Activates the Python virtual environment, loads environment variables, and executes the `spendee_mcp.py` script.
11
+
***`run.py`**: A script for manual testing and interaction with the `SpendeeApi` and `SpendeeFirestore` classes. It's useful for debugging and experimentation.
12
+
***`run_tests.sh`**: The test runner script. It checks for a `.env` file and then executes the test suite using `pytest`.
13
+
***`re-deploy.sh`**: This script was requested for documentation but does not exist in the repository.
14
+
15
+
## Dockerfile
16
+
The `Dockerfile` sets up a Python 3.11 environment, installs dependencies from `requirements.txt`, copies the application code, and defines the entry point to run the MCP server.
Spendee is a personal finance application that helps users track their expenses and income. This client library provides a Python interface to the Spendee API.
5
+
6
+
## Core Concepts
7
+
***Wallets:** Wallets represent your accounts (e.g., bank account, cash).
8
+
***Transactions:** Transactions are individual expenses or incomes.
9
+
***Categories:** Categories help you classify your transactions (e.g., food, transportation).
10
+
***Labels:** Labels provide an additional way to organize your transactions.
11
+
12
+
For more details on the data model, please refer to the [Firestore Schema](firestore-schema.md).
13
+
14
+
---
15
+
For implementation details, see `spendee/agents.md`.
This project uses a combination of unit tests and integration tests to ensure code quality. We use `pytest` as our primary testing framework.
5
+
6
+
## MCP Testing
7
+
MCP tests are located in the `tests/mcp` directory. These tests focus on verifying the logic of the orchestration tasks.
8
+
9
+
## Spendee Firestore Testing
10
+
Spendee Firestore tests are located in the `tests/spendee` directory. These tests focus on verifying the interaction between the Spendee client and the Firestore database.
11
+
12
+
---
13
+
For implementation details, see `tests/agents.md`.
0 commit comments