Skip to main content

libmonzo

A Python library for interacting with Monzo bank accounts that can handle OAuth authentication.

Installation

pip install libmonzo

Setup

To use this library, you'll need to create your own client on the Monzo developer site: https://developers.monzo.com/apps/home

The name, logo, and description can be whatever you want it to be. Set the "Confidentiality" to "Not Confidential" and set the redirect URL to "http://localhost:36453/monzo_callback" (or whatever you like if you will be providing the access token).

You'll need to store the client ID, the owner ID and the client secret for use in setup of the client later.

Example:

import libmonzo

client = libmonzo.MonzoClient(client_id, owner_id, client_secret)

# Via OAuth (it will open a browser window)
client.authenticate()

# Or providing the access token directly
client.access_token = "..."

# Getting accounts
for account in client.accounts():
    print(account.owners[0].preferred_name)

# Get the balance of an account
account = client.accounts()[0]
balance_info = client.balance(account_id=account.identifier)
print(balance_info.balance)

Supported APIs

  • Listing accounts
  • Reading balance
  • Listing pots
  • Depositing into pots
  • Withdrawing from pots
  • Retrieving a transaction
  • Listing transactions
  • Creating feed items
  • Uploading and setting attachments
  • Removing attachments
  • Registering webooks
  • Listing webhooks
  • Removing webhooks

Annotating transactions will be coming soon. There appears to be a minor bug causing problems at this point, so it's not quite ready.

Known issues

This was written because I needed it for a small personal project. Because of that, there are some issues. I'm open to PRs to fix these though.

  • The OAuth setup isn't 100% reliable and could be better
  • Limited error checking
  • Limited bounds/variable checking
  • Lack of useful error messages
  • Design could be cleaner
  • The tests require a local configuration file to even run
  • Plus so many more

Release files for libmonzo 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libmonzo 0.1
File Size Uploaded
libmonzo-0.1.tar.gz 10.7 kB Details

Release files / libmonzo-0.1.tar.gz

Download URL libmonzo-0.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8d194f8e32e4f929c1f931253e872774428d059b6ba4c30a426df234e992a6d4
BLAKE2b-256 checksum
How to use checksums
e80d0f8666e7b8cb1cefd5bf868ed20c6f22734535cd18621c4307f71c80c602
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.0

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page