This repository implements a small system for generating reports summarising You Need A Budged monthly movements and historical positions. The data is obtained using the YNAB API and the reports are generated using LaTeX.
July 4th, 2021
- Feat: add example Dockerfile
- Feat: add YoY column
- Several minor bugfixes
December 3rd, 2020
- Feat: add multi-budget functionality, with possibility of different currencies
- Feat: add possibility to exclude categories of the calculations
Follow the next steps to have the project running in your system:
- Install pyenv and poetry in your system following the linked official guides.
- Open a terminal, clone this repository and
cd
to the cloned folder. - Run
pyenv install $(cat .python-version)
in your terminal for installing the required python. version. - Configure poetry with
poetry config virtualenvs.in-project true
. - Create the virtual environment with
poetry install
. - Make sure you have LaTeX installed in your system (or install it with
sudo apt-get install texlive-full
) with the needed dependencies. - Create the
config/ynab.toml
file following the example in the same folder and fill-in your budget name and API key. - Do the same with the
config/email.toml
file. The example contained in this repository has the settings for gmail pre-filled in. - Activate the environment with
source .venv/bin/activate
. - Run
python main.py -y <report-year> -m <report-month>
to generate a report for the specified date.
It might be useful to set up a crontab to run the system every month. In my case, I run it the 5th day of every month, for calculating the report corresponding with the previous month. The crontab entry is shown below as an example.
0 9 5 * * cd ~/projects/ynab-reporter && .venv/bin/python main.py -m `date +\%-m --date="1 month ago"` -y `date +\%Y --date="1 month ago"` -e [email protected] [email protected]
The following image shows how the report looks like. Notice that all the data shown in it has been randomly generated.
Pull requests and issues will be tackled upon availability.
This repository is licensed under MIT license. More info in the LICENSE file. Copyright (c) 2020 Iván Vallés Pérez