Skip to main content

German banking API client for account data and transactions

Project description

geldstrom

Pure-Python FinTS 3.0 client for German banking. Handles protocol parsing, dialog management, decoupled TAN (SecureGo+, pushTAN, …), and exposes a synchronous API for reading accounts, balances, and transaction history.

Package layout

geldstrom/
├── clients/
│   ├── base.py               # BankClient protocol
│   ├── fints3.py             # FinTS3Client — blocking, context-manager
│   └── fints3_decoupled.py   # FinTS3ClientDecoupled + PollResult
├── domain/
│   └── model/
│       ├── accounts.py       # Account, AccountOwner, AccountCapabilities
│       ├── balances.py       # BalanceSnapshot, BalanceAmount
│       ├── bank.py           # BankRoute, BankCapabilities, BankCredentials
│       └── transactions.py   # TransactionEntry, TransactionFeed
└── infrastructure/
    └── fints/
        ├── challenge/        # Challenge, ChallengeHandler, TANConfig,
        │                     # DecoupledTANPending, DetachingChallengeHandler
        ├── credentials.py    # GatewayCredentials (FinTS connection bundle)
        ├── dialog/           # Wire-level FinTS dialog (connection, security,
        │                     # message, responses, TAN strategies)
        ├── exceptions.py     # FinTSClientPINError, FinTSConnectionError, …
        ├── operations/       # FinTS operations (accounts, balances,
        │   └── transactions/ # transactions: mt940, camt, feed pipelines)
        ├── protocol/         # Tokenizer, parser, segment/DEG definitions
        ├── services/         # High-level service objects used by clients
        │                     # (FinTSAccountService, FinTSBalanceService,
        │                     #  FinTSTransactionService, FinTSMetadataService)
        ├── session.py        # FinTSSessionState, SessionToken protocol
        ├── support/          # FinTSConnectionHelper, serialization helpers
        └── tan.py            # TANMethod value object

Quick start

from geldstrom import FinTS3Client

with FinTS3Client(
    bank_code="12345678",
    server_url="https://banking.example.com/fints",
    user_id="your_user",
    pin="your_pin",
    product_id="YOUR_PRODUCT_ID",
    tan_method="946",   # required by most banks even for read-only ops
) as client:
    accounts = client.list_accounts()
    balance  = client.get_balance(accounts[0])
    feed     = client.get_transactions(accounts[0])

Clients

FinTS3Client

Standard blocking client. Call connect() (or use as a context manager) to open a dialog and discover accounts. Subsequent method calls reuse the cached session. Use session_state to persist the session across process restarts.

FinTS3ClientDecoupled

Subclass of FinTS3Client that raises DecoupledTANPending instead of blocking when the bank requires an app-based confirmation. The live connection context is kept alive internally; call poll_tan() in a loop until status == "approved". The gateway uses this variant for all requests.

from geldstrom import FinTS3ClientDecoupled, DecoupledTANPending

client = FinTS3ClientDecoupled(...)
try:
    feed = client.get_transactions(account)
except DecoupledTANPending:
    while True:
        result = client.poll_tan()
        if result.status == "approved":
            feed = result.data
            break
        elif result.status == "pending":
            time.sleep(2)
        else:
            raise RuntimeError(result.error)

TAN handling

Most German banks require a TAN (2FA) even for read-only operations.

  • Pass tan_method (e.g. "946" for SecureGo+/decoupled TAN) to avoid a runtime warning.
  • Call client.get_tan_methods() to discover all methods advertised by the bank; this performs a lightweight sync dialog that does not require a TAN.
  • TANConfig controls polling behaviour (poll_interval, timeout_seconds).
  • ChallengeHandler is a protocol for custom challenge presentation — the default DetachingChallengeHandler raises DecoupledTANPending for decoupled challenges.

Session persistence

FinTS3Client.session_state returns a FinTSSessionState after connect(). Serialize it with .serialize() and reconstruct with FinTSSessionState.deserialize(data). Pass the reconstructed state as session_state=... to skip the initial sync dialog on subsequent runs.

Examples

See examples/ in the repository root for runnable demos (account listing, balance fetching, transaction history, TAN flow walkthrough).

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

geldstrom-0.1.0.tar.gz (84.0 kB view details)

Uploaded Source

Built Distribution

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

geldstrom-0.1.0-py3-none-any.whl (126.1 kB view details)

Uploaded Python 3

File details

Details for the file geldstrom-0.1.0.tar.gz.

File metadata

  • Download URL: geldstrom-0.1.0.tar.gz
  • Upload date:
  • Size: 84.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for geldstrom-0.1.0.tar.gz
Algorithm Hash digest
SHA256 85655d3629629763d97ca883a2f33d9762ec7d44e0bef13432e039a2131e0644
MD5 43592d9cb6e4a17958c5140274196ab1
BLAKE2b-256 fb54f78981d208f84d423ed07b668bafe9571c6f42ba7ca18eebee5d10add8af

See more details on using hashes here.

Provenance

The following attestation bundles were made for geldstrom-0.1.0.tar.gz:

Publisher: geldstrom-publish.yml on maltewinckler/geldstrom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file geldstrom-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: geldstrom-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 126.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for geldstrom-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4375e56c5e015ea3fae52d3fef5732b29670c0a04a4b5aed26a87adfa345d5a4
MD5 ed0b4b7f5cb9cd416e7da769a362441c
BLAKE2b-256 9a0788d923d10efb1f9b323ae1045ce56d52d418ca4b079c9036ec96ed5cb0f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for geldstrom-0.1.0-py3-none-any.whl:

Publisher: geldstrom-publish.yml on maltewinckler/geldstrom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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