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.11.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.11-py3-none-any.whl (37.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beancount_gocardless-0.1.11.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.11.tar.gz
Algorithm Hash digest
SHA256 057593cd9cfaef6e82c4f838565015aedd12bcc4fb1e6c0e2133f490b583477f
MD5 0fbb5a1290029775abb41fe0567e0f73
BLAKE2b-256 f94d9c470f4326c3aa942944881913345fa8cdd0b314a6c6f45ab2362d508846

See more details on using hashes here.

File details

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

File metadata

  • Download URL: beancount_gocardless-0.1.11-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.11-py3-none-any.whl
Algorithm Hash digest
SHA256 03f83dd62b96ee1a102cbd640de5feb9d74a413d606fc76e9393b4f7af3ba619
MD5 40db49994a298aa686e2a06afd2ff1e2
BLAKE2b-256 29d854d8bafddf42e64ee227d1f50e2ee7de6c5fc6d291d199d3e670fcae32e5

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