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.2.tar.gz (85.2 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.2-py3-none-any.whl (127.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geldstrom-0.1.2.tar.gz
  • Upload date:
  • Size: 85.2 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.2.tar.gz
Algorithm Hash digest
SHA256 6ef2c11c56b07d0a56ba72771c934570dc1f153bb347336a7e0e6a13aa5c83d6
MD5 64a81698296e1002f8eaed8d18866c69
BLAKE2b-256 f947a8bad9be38ff296e1636320d7ee3dac4a26be31c6748b8b8ce6d1678f673

See more details on using hashes here.

Provenance

The following attestation bundles were made for geldstrom-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: geldstrom-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 127.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 171f1e0df54692a12c7516304bd6e611033129af4bcf5952ed1ecede1f066fb2
MD5 5c465079be6f075bb4e1a4deb464e791
BLAKE2b-256 8efe7c842f6791219a69196f1d0519d96ab0eb5f5379ee3bcc57dcf8be1bdead

See more details on using hashes here.

Provenance

The following attestation bundles were made for geldstrom-0.1.2-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