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.2.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.2.tar.gz.

File metadata

File hashes

Hashes for csob_ceb_business_connector_sdk-0.2.2.tar.gz
Algorithm Hash digest
SHA256 843c530b1de99c24ef2eb060801dfe58bc62846fb3bd756bfc07d68893f7f6b7
MD5 344f8cdbd916a48e4955d9c597fffb16
BLAKE2b-256 0bfb4a6419a197591d410421d2c4c99c90b823b62dcd21118872956bcb94dd46

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for csob_ceb_business_connector_sdk-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c6f02f8e010d336df2350cce6afc941ba1637c10e30264659441e258babd6489
MD5 7c0e9cde102a961d101e5f32a5ca0708
BLAKE2b-256 a4590b8ce4fd456c0cf065c76bac742f8b682dbd6f46b878d931e864ee9473b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for csob_ceb_business_connector_sdk-0.2.2-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