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"
#### 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.9.tar.gz (40.2 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.9-py3-none-any.whl (38.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beancount_gocardless-0.1.9.tar.gz
  • Upload date:
  • Size: 40.2 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.9.tar.gz
Algorithm Hash digest
SHA256 d4f7028b6a30a035bf17d0895cfc553b0bce2ea92e1ea64b6e494d99e94ca3f9
MD5 1f7a3fc1a4760a7987aedac4525b3c5c
BLAKE2b-256 f1d6d19de52db36a35a6aa5857247c20ceca7f84994cb755318024fe86215a9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: beancount_gocardless-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 38.6 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.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1f35daf5870f8947d7afc2b19fd9a33ccc47ba4557b8f4ffd4fca868571493ec
MD5 f99ae2bef86bb20db84e2e385d42103d
BLAKE2b-256 f02b0a902e6b4ecc0509395bacec3fc2b04d38ca7d99210f3606f3ac98e1f96a

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