I've created a dockerised Airflow data engineering project which automates the use of Monzo's Public API to get your transactions into a database and more!

I think we can all agree that the Google Sheets export tool by Monzo is fantastic, but has some limitations. For example, I could not see any standing orders/direct debits on my export sheet, and any changes made in a transaction after the event would not be reflected in the export.

While I was working on automating my finances in the past year I wanted to:

  • Automate the update of my own database with all my Monzo transactions, with metadata and category information
  • Automate the movement of money between pots and main account at specific hours/days and based on logic (e.g. only move enough money to Pot to reach a certain budget)
  • Trigger custom push notifications to update me on my balance, spending or warn me when I’ve made my 5th Deliveroo purchase in any given month!
  • Automate the update of my Notion database tables so I can manage everything in one dashboard on Notion.

I’d like to share this project I started with anyone who might be interested in trying it out and tweaking the pipelines to their own liking. Airflow is the tool I have used to orchestrate daily fetches of Monzo transactions and stores it in a local Postgres database. I’ve included Metabase as a docker image to visualise the data as pushing data to my Notion page required a third party API and hosting my Postgres database in AWS cloud instead of locally (and everything ran on an EC2 instance) - but this was costly.

Many thanks to all the developers at Monzo for making this possible with the public API and credit to others who have created python packages to make interacting with it easy!

Link to the Github repo: GitHub - eliasbenaddou/personal_finance_de_project: A dockerised Airflow repository to automate API calls to your bank account (only Monzo currently supported) to store transactions in a Postgres database, check data quality with Great Expectations and visualise your data on Metabase.

I would love to hear suggestions about what could be improved and how you would use it!

3 Likes

Oh wow. Love stuff like this. Thanks so much for sharing!

Something to take a proper look at over Christmas. :eyes:

2 Likes

This looks great! Would/could it include the joint account?

They should be on the sheet and any changes after the fact should also be reflected. The only thing that is completely missing is virtual card direct from a pot.

I’m not familiar with the Airflow but intimately familiar with the python package.

I believe the joint accounts show under the normal accounts under the tag uk_joint so if the airflow doesn’t currently, im sure it could be modified to do so. Personally don’t have a joint account to test

1 Like

Happy to hear your thoughts on it when you get round to it :slight_smile:

1 Like

I wasn’t sure how to tag your name on the post, so thank you for the brilliant Monzo-api package that this depends on!

Also don’t have a joint account to test with, however I think you’re right that I could implement it into another pipeline specifically for joint accounts - the only difference would be filtering on accounts with the tag ‘uk_joint’. I’m not sure how far the public API works with joint accounts though.

1 Like

Thanks for correcting - It now must be a while since I’ve used the export functionality (I used to use IFTTT years ago to do it). That’s right, and something that I could add here is to also fetch transactions that occur via virtual cards from different pots.

The slight issue is first finding the Pot account ID for each pot, which isn’t retrievable if you have no transactions yet, so will first need to transfer money from your main account to the Pot. I think I then found the pot_Account_id from looking at the transfer transaction from my main account.

2 Likes

I must be getting old. I was technical once you know (shakes walking stick). I don’t even understand the thread title let alone the content.

5 Likes