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.10.tar.gz (41.1 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.10-py3-none-any.whl (38.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beancount_gocardless-0.1.10.tar.gz
  • Upload date:
  • Size: 41.1 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.10.tar.gz
Algorithm Hash digest
SHA256 8f03d246dce579248ecc37090fdbd09d615eef96dbddb53b69439c7204ff8d74
MD5 3697da3a1ee59affc8adfadc738146a1
BLAKE2b-256 925b64857628898cd0af0385f8816c22c98504e3a3951952ade2808989e59bfa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: beancount_gocardless-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 38.5 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.10-py3-none-any.whl
Algorithm Hash digest
SHA256 8a82a9aaeefbc3cc45799fdd733403eddf531a6e1017f0d1141293017a9bbb19
MD5 1bb008617839ca4711759762125d4753
BLAKE2b-256 125ac211dbeccc22dcff86250f97f026da2b145dfbca354cb0f2648289dedee3

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