Due to Mint.com closing, I transition to Lunchmoney.app for tracking my spending and managing budgets. One feature I missed from Mint was the chart which showed how I was tracking compared to the previous month. As Lunchmoney has shared an API, I created my own script to generate a similar chart.
Create a file called .env
in the root folder of this project. The variables included should be:
LM_API_KEY="xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz"
LM_HOSTNAME="https://dev.lunchmoney.app"
You can get an API key from lunchmoney.
It’s typically recommended to use virtual environments when working with specific applications, so:
python3 -m venv .venv
// create virtual environment for this directorysource .venv/bin/activate
// activate itpip install -r requirements.txt
// install requirements
All dependencies will be installed for the project; proceed.
You can run the code using;
$ python comparison.py
The final graph looks like this -- not pretty but has all the information needed.
- Need to align the days of the month better, currently the x-axis are the dates from the previous month. This causes slight visualization issue when months have different dates (e.g. Feb & Mar)