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

Uploaded Python 3

File details

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

File metadata

  • Download URL: geldstrom-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 fe43f87f21e4571e7dae7b53c955d46a394b88a74e5315b0341971b06c6c975f
MD5 2b8b83861189d2767e66c4efadfc233c
BLAKE2b-256 5115ee1a5e8653747db76b1c436a2358677b545fc617d1471eb0936f1c4e3a96

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: geldstrom-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01348fdb74fad8c8c6ed0f10bf21bbcfcb395d4deaa06053f4bbf04a9322686f
MD5 269add37f3ad16853306c5b73158fd29
BLAKE2b-256 674e8e40502cc7b5cb9a6134313603d3a1cbac693c07011a990f543632f3af2c

See more details on using hashes here.

Provenance

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