Skip to main content

Python SDK for ČSOB CEB Business Connector

Project description

ČSOB CEB Business Connector SDK

Production-ready Python SDK for automated file download and upload via ČSOB CEB Business Connector.

Features

  • SOAP orchestration: GetDownloadFileList v4, StartUploadFileList v3, FinishUploadFileList v2
  • REST transfer: Streaming download, multipart upload
  • mTLS: Certificate validation, PEM/KEY/PFX support
  • Stateful idempotency: SQLite persistence with WAL, crash recovery
  • Rate limiting: Token bucket per contract/certificate
  • Retry policies: Exponential backoff + jitter via tenacity
  • Audit logging: Structured JSON logs with redaction

Installation

pip install "csob-ceb-business-connector-sdk[async]"

Quickstart

import asyncio
from pathlib import Path
from csob_ceb_bc import BusinessConnectorClient, ConnectorConfig, CertificateConfig, Environment
from csob_ceb_bc.models import DownloadFilter, UploadFile, UploadMode

async def main():
    client = BusinessConnectorClient.from_config(
        ConnectorConfig(
            environment=Environment.PRODUCTION,
            contract_number="YOUR_CONTRACT",
            client_app_guid="your-guid",
            certificate=CertificateConfig(
                cert_file=Path("/secure/cert.crt"),
                key_file=Path("/secure/key.key"),
            ),
            state_url="sqlite:////var/lib/csob-ceb/state.db",
        )
    )

    files = await client.download_new_files(
        filter=DownloadFilter(file_types=["VYPIS", "AVIZO"]),
        target_dir=Path("./inbox"),
    )

    result = await client.upload_payment_batch(
        file=Path("payments.xml"),
        metadata=UploadFile(
            filename="payments.xml",
            format="XML SEPA",
            mode=UploadMode.AllOrNothing,
        ),
    )

    await client.poll_import_protocols()
    await client.resume_pending()

asyncio.run(main())

Configuration

Environment variables (prefix CSOB_BC_):

CSOB_BC_CONTRACT_NUMBER=123456
CSOB_BC_ENVIRONMENT=production
CSOB_BC_CLIENT_APP_GUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

YAML config:

environment: production
contract_number: "123456"
client_app_guid: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
certificate:
  cert_file: "/etc/csob/cert.crt"
  key_file: "/etc/csob/key.key"
state_url: "sqlite:////var/lib/csob-ceb/state.db"

Security

  • Private keys must have permissions 400 or 600
  • Certificate expiry is checked at startup
  • Logs redact contract numbers and sensitive URL parameters
  • Bank file contents are never logged
  • verify=False is never used

Development

pip install -e ".[dev]"
pytest
ruff check .
ruff format .
mypy src

Troubleshooting

Issue Cause Solution
SOAP 1101 Rate limit exceeded Increase polling interval, check parallel clients
SOAP 1011 Certificate not registered Register certificate in CEB portal
SOAP 1012 Certificate blocked Security incident, contact bank
HTTP 400/404 Download URL expired File older than 15 days, no recovery possible
Upload rejected (R) Duplicate or invalid file Check hash, format, filename length

License

MIT

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

csob_ceb_business_connector_sdk-0.2.1.tar.gz (199.0 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file csob_ceb_business_connector_sdk-0.2.1.tar.gz.

File metadata

File hashes

Hashes for csob_ceb_business_connector_sdk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 038929b2ccac7070c0933a693be25034697791d992f813d7e2dc7710e9c530d8
MD5 72f8f1f5aa9610ff21fa22f520f12169
BLAKE2b-256 cbfa73d1b9a4afb31905e9380f4c7f2cc743cdba9ed1ebe6cbcaa2616bbd5b64

See more details on using hashes here.

Provenance

The following attestation bundles were made for csob_ceb_business_connector_sdk-0.2.1.tar.gz:

Publisher: publish.yml on thinkhome-org/csob-ceb-bc

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

File details

Details for the file csob_ceb_business_connector_sdk-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for csob_ceb_business_connector_sdk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e397b09ab9d25de62c284d8142ab26f20633d03f654c1d9a2f4e04d85aea1866
MD5 43f0304723949724036393ba9455f294
BLAKE2b-256 64326e7d9a8fb4c19029ff1f9176d0e821fd63899a64a43a748173c449b73bf6

See more details on using hashes here.

Provenance

The following attestation bundles were made for csob_ceb_business_connector_sdk-0.2.1-py3-none-any.whl:

Publisher: publish.yml on thinkhome-org/csob-ceb-bc

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