Skip to main content

No project description provided

Project description

beancount-gocardless

GoCardless API client with models manually recreated from swagger spec, plus Beancount importer.

Inspired by https://github.com/tarioch/beancounttools.

Full documentation at https://beancount-gocardless.readthedocs.io/en/latest/.

Key Features:

  • API Client: Models based on swagger spec. Built-in caching via requests-cache.

  • GoCardLess CLI: A command-line interface to manage authorization with the GoCardless API:

    • Listing available banks in a specified country (default: GB).
    • Creating a link to a specific bank using its ID.
    • Listing authorized accounts.
    • Deleting an existing link.
    • Uses environment variables (GOCARDLESS_SECRET_ID, GOCARDLESS_SECRET_KEY) or command-line arguments for API credentials.
  • Beancount Importer: A beangulp.Importer implementation to easily import transactions fetched from the GoCardless API directly into your Beancount ledger.

You'll need to create a GoCardLess account on https://bankaccountdata.gocardless.com/overview/ to get your credentials.

Development

API Coverage

The GoCardless client provides complete API coverage with Pydantic models for all endpoints and data structures:

🏦 Core Banking:

  • Accounts: Full account metadata, balances, details, and transactions
  • Institutions: Bank/institution information and capabilities
  • Requisitions: Bank link management with full lifecycle support

📋 Agreements & Permissions:

  • End User Agreements: Complete agreement lifecycle management
  • Access Scopes: Granular permission control
  • Reconfirmations: Agreement renewal workflows

🔧 Advanced Features:

  • Integrations: Institution capability discovery
  • Token Management: JWT token handling (internal)
  • Pagination: Full paginated response support
  • Error Handling: Error response models

📊 Rich Data Models:

  • Transactions: Complete transaction details with currency exchange, balances, and metadata
  • Balances: Multi-currency balance information with transaction impact
  • Account Details: Extensive account information including ownership and addresses

Models manually recreated from the swagger spec, providing type-safe access to every API feature.

Installation:

pip install beancount-gocardless

Usage

#### gocardless.yaml
secret_id: $GOCARDLESS_SECRET_ID
secret_key: $GOCARDLESS_SECRET_KEY

cache_options: # by default, no caching if cache_options is not provided
  cache_name: "gocardless"
  backend: "sqlite"
  expire_after: 3600
  old_data_on_error: true

accounts:
    - id: <REDACTED_UUID>
      asset_account: "Assets:Banks:Revolut:Checking"
      transaction_types: ["booked", "pending"]  # optional, defaults to both
#### my.import
#!/usr/bin/env python

import beangulp
from beancount_gocardless import GoCardLessImporter
from smart_importer import apply_hooks, PredictPostings, PredictPayees

importers = [
    apply_hooks(
        GoCardLessImporter(),
        [
            PredictPostings(),
            PredictPayees(),
        ],
    )
]

if __name__ == "__main__":
    ingest = beangulp.Ingest(importers)
    ingest()

Import your data from GoCardLess's API

python my.import extract ./gocardless.yaml --existing ./ledger.bean

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

beancount_gocardless-0.1.12.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beancount_gocardless-0.1.12-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

Details for the file beancount_gocardless-0.1.12.tar.gz.

File metadata

  • Download URL: beancount_gocardless-0.1.12.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for beancount_gocardless-0.1.12.tar.gz
Algorithm Hash digest
SHA256 e4f30202ab0f3c8d4b0e4e128f58f24d17367b166ecc5f1c3bf175809aef4e6e
MD5 66f1ffa168b5df53bd109adb5393298b
BLAKE2b-256 ea2b4efa1bba2428c05686b9edb4c09e78c9de437a89b16541456b6833d41108

See more details on using hashes here.

File details

Details for the file beancount_gocardless-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: beancount_gocardless-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 37.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for beancount_gocardless-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 3fd0331a9d3467de193f2d791c11c47a4ebe6ba2ade9a2cdbff7d2ac0484df92
MD5 aad117bf33c4a93862cba4399eb2524b
BLAKE2b-256 6791f79b7d2f0701317d523f730dc642d969b8b760095f88e250e70ba0619428

See more details on using hashes here.

Supported by

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