mtthidoteu / credit-monzo

13 stars 3 forks source link

Credit-Monzo

A script to synchronise Credit Card Transactions and Monzo, which can be setup to be run every 15 minutes via cron.

Requirements

Supported Credit Card

I haven't personally tested all of these but I don't see why it shouldn't work! The truelayer api is pretty straightforward

:exclamation: Attention :exclamation:

The issue with the refresh token I had highlighted was in fact a misconfiguration! When you are creating your Monzo 'client', make sure to make it 'Confidential"!

Work In progress

Environment Variables

To run this project, you will need to add the following environment variables to your .env file. Duplicate the .env.example file and rename to .env, then fill out the details. The database can be whatever you want to call the database file.

Installation and Setup

Clone the project into directory

  git clone https://github.com/mtthidoteu/credit-monzo
  pip install -r requirements.txt
  python script.py auth

Running

Once the setup has been completed. You should be able to run a synchronisation by running

python script.py run

This will download all your 'pending transactions' from your Credit Card account and add them to our database. It will then deposit that amount into a pot!

Making script run dynamically

You will probably have noticed but this script doesn't monitor transactions it only checks the transactions once and exists. What I would recommend if having a cronjob or something similar have the script run every 15 minutes for instance.

For example:

*/15 * * * * /path/to/python/or/venv /path/to/cloned/repository/app.py run

FAQ

I am getting Error TypeError: 'type' object is not subscriptable

Please upgrade to > Python3.9

How will I know if my tokens have expired?

Currently I haven't implemented a very good error notification system and the script won't really throw errors. It'll just keep trying. However, if you notice it stops working, re-run python script.py auth

License

Common Clause