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 tries to provide complete API coverage with Pydantic models for all endpoints and data structures. Models are 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 list, defaults to both
      preferred_balance_type: "interimAvailable"  # optional, use specific balance type
#### my.import
#!/usr/bin/env python

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

importers = [
    GoCardLessImporter()
]

hooks = [
    PredictPostings().hook,
    PredictPayees().hook,
]

if __name__ == "__main__":
    ingest = beangulp.Ingest(importers, hooks=hooks)
    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.13.tar.gz (42.3 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.13-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beancount_gocardless-0.1.13.tar.gz
  • Upload date:
  • Size: 42.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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.13.tar.gz
Algorithm Hash digest
SHA256 96c323edcec7fca39431eb68bbb3966171c4201e37a45d92063ee314cd1eb91a
MD5 a7c6f3d4389fd0197c2d3b2ed82f9d88
BLAKE2b-256 acf66b811c48f14de02008cfb1b8297f96f32d18ea2c42066af48caf645787ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: beancount_gocardless-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 cbe5d68cd85f858c1efbd5234b63778019f3330b8370fb540063a53d878ced83
MD5 3cc0b42c53d61f49307ec805dfc2d0ca
BLAKE2b-256 ea7b0d59141c2d5a9ca74ef6f5f0a409a73344304ad662ce80f0658dbdb7a183

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