Skip to main content

An Open Banking CLI

Project description

💲 leggen

An Open Banking CLI.

This tool aims to provide a simple way to connect to banks using the GoCardless Open Banking API.

Having a simple CLI tool to connect to banks and list transactions can be very useful for developers and companies that need to access bank data.

Having your bank data in a database, gives you the power to backup, analyze and create reports with your data.

🛠️ Technologies

📦 Storage

  • SQLite: for storing transactions, simple and easy to use
  • MongoDB: alternative store for transactions, good balance between performance and query capabilities

⏰ Scheduling

  • Ofelia: for scheduling regular syncs with the database when using Docker

📊 Visualization

  • NocoDB: for visualizing and querying transactions, a simple and easy to use interface for SQLite

✨ Features

  • Connect to banks using GoCardless Open Banking API
  • List all connected banks and their statuses
  • List balances of all connected accounts
  • List transactions for all connected accounts
  • Sync all transactions with a SQLite and/or MongoDB database
  • Visualize and query transactions using NocoDB
  • Schedule regular syncs with the database using Ofelia
  • Send notifications to Discord and/or Telegram when transactions match certain filters

🚀 Installation and Configuration

In order to use leggen, you need to create a GoCardless account. GoCardless is a service that provides access to Open Banking APIs. You can create an account at https://gocardless.com/bank-account-data/.

After creating an account and getting your API keys, the best way is to use the compose file. Open the file and adapt it to your needs.

Example Configuration

Create a configuration file at with the following content:

[gocardless]
key = "your-api-key"
secret = "your-secret-key"
url = "https://bankaccountdata.gocardless.com/api/v2"

[database]
sqlite = true
mongodb = true

[database.mongodb]
uri = "mongodb://localhost:27017"

[notifications.discord]
webhook = "https://discord.com/api/webhooks/..."

[notifications.telegram]
# See gist for telegram instructions
# https://gist.github.com/nafiesl/4ad622f344cd1dc3bb1ecbe468ff9f8a
token = "12345:abcdefghijklmnopqrstuvxwyz"
chat-id = 12345

[filters.case-insensitive]
filter1 = "company-name"

Running Leggen with Docker

After adapting the compose file, run the following command:

$ docker compose up -d

The leggen container will exit, this is expected since you didn't connect any bank accounts yet.

Run the following command and follow the instructions:

$ docker compose run leggen bank add

To sync all transactions with the database, run the following command:

$ docker compose run leggen sync

👩‍🏫 Usage

$ leggen --help
Usage: leggen [OPTIONS] COMMAND [ARGS]...

  Leggen: An Open Banking CLI

Options:
  --version          Show the version and exit.
  -c, --config FILE  Path to TOML configuration file
                      [env var: LEGGEN_CONFIG_FILE;
                       default: ~/.config/leggen/config.toml]
  -h, --help         Show this message and exit.

Command Groups:
  bank  Manage banks connections

Commands:
  balances      List balances of all connected accounts
  status        List all connected banks and their status
  sync          Sync all transactions with database
  transactions  List transactions

⚠️ Caveats

  • This project is still in early development, breaking changes may occur.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leggen-0.6.11.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

leggen-0.6.11-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file leggen-0.6.11.tar.gz.

File metadata

  • Download URL: leggen-0.6.11.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.2

File hashes

Hashes for leggen-0.6.11.tar.gz
Algorithm Hash digest
SHA256 b03074bcdcf41d2bb957765ba764a3eaaf39e1b4f8f80e566f38edfce9aff91f
MD5 d2dc7dd04997a75b02b784c732d649a4
BLAKE2b-256 892906d5af8c34d73bcc7938bd43f072455b1609ff8275a1717811234f1c7b66

See more details on using hashes here.

File details

Details for the file leggen-0.6.11-py3-none-any.whl.

File metadata

  • Download URL: leggen-0.6.11-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.2

File hashes

Hashes for leggen-0.6.11-py3-none-any.whl
Algorithm Hash digest
SHA256 da7b048cdff9623f32e00448fc0f125028dc50a0085a90ccf220891218540af6
MD5 3d0290a93f8ab1d3f5d628dbc9171510
BLAKE2b-256 274598e81e878bb883b904969d1e4ff2c1bca3e1fcb3d8b43048967bc446f832

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page