Git Product home page Git Product logo

credit-monzo's Introduction

Credit-Monzo

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

Requirements

  • Monzo Account
  • Support Credit Card
  • Python >3.9 (Virtual Env is recommended!)

Supported Credit Card

  • American Express
  • Barclaycard (untested*)
  • Capital One (untested*)
  • Tesco Bank (untested*)

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

โ— Attention โ—
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

  • GUI for setting up and monitoring

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

  • truelayer_client_id

  • truelayer_client_secret

  • monzo_client_id

  • monzo_client_secret

  • pot_id

  • monzo_account_id

  • database_file

Installation and Setup

  • On your Monzo App, create an American Express Pot

Clone the project into directory

  git clone https://github.com/mtthidoteu/credit-monzo
  • Create a TrueLayer Account
  • Make sure you are in 'LIVE' Mode (upright toggle)
  • Create Data API Client_ID and client_secret add add to .env file
  • Login to Monzo Developers and login with Monzo Account
  • In Monzo Playground, make a GET request to /pots?current_account_id=$account_id
  • Locate and Add your Credit Pot's ID into .env
  • Make note of your 'account_id' and add it to .env
  • In Monzo Developers, create a Client with Redirect URL set to http://127.0.0.1:5000/callback and 'Confidentiality' set to 'Confindetial'!
  • Add newly created Client ID and Client Secret to .env
  • Install dependencies
  pip install -r requirements.txt
  • Run authentication script
  python script.py auth
  • Following Instructions carefully! Make sure to read each line!
  • If the script has succeeded, you should be good to go!

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

credit-monzo's People

Contributors

mtthidoteu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.