Skip to main content

Python client for Cebeo B2B XML API

Project description

cebeo-client

Python client for Cebeo's B2B XML API.

Installation

pip install cebeo-client

Usage

from cebeo_client import CebeoClient

client = CebeoClient(
    customer_number="123456",
    username="your_username",
    password="your_password",
)

# Lookup articles by Cebeo article IDs
articles = client.article_get(["169509", "171418"])
for article in articles:
    print(f"{article.supplier_item_id}: {article.description}")
    print(f"  Price: {article.net_price} EUR")
    print(f"  Stock: {article.stock} ({article.stock_code})")
    print(f"  Available: {article.is_available}")

# Search for articles
result = client.article_search(keywords=["XVB"], brand_keywords=["Niko"])
print(f"Found {result.total_count} articles")
for article in result.articles:
    print(f"  {article.reference}: {article.description}")

Configuration

client = CebeoClient(
    customer_number="123456",
    username="user",
    password="pass",
    base_url="https://b2b.cebeo.be/webservices/xml",  # default
    timeout=30,      # request timeout in seconds
    batch_size=50,   # max articles per API request
)

Error Handling

from cebeo_client import CebeoAPIError, CebeoAuthError, CebeoConnectionError

try:
    articles = client.article_get(["123"])
except CebeoAuthError as e:
    print(f"Authentication failed: {e}")
except CebeoAPIError as e:
    print(f"API error {e.code}: {e.message}")
except CebeoConnectionError as e:
    print(f"Connection failed: {e}")

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linter
ruff check src tests

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

cebeo_client-0.4.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

cebeo_client-0.4.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file cebeo_client-0.4.0.tar.gz.

File metadata

  • Download URL: cebeo_client-0.4.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cebeo_client-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b066cc9468a1cacbbd5feb7b5e4045a745e4e0d41de9cf6a40823bdc4571603c
MD5 2be4f101d59d7d9cbcc19cb9cbc08e28
BLAKE2b-256 04fe89a04982e7a2c3c125e09bdd9f5048d40715344a424eb140a835e8c46290

See more details on using hashes here.

Provenance

The following attestation bundles were made for cebeo_client-0.4.0.tar.gz:

Publisher: publish.yml on elektriciteit-steen/cebeo-client

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

File details

Details for the file cebeo_client-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: cebeo_client-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cebeo_client-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a1f39c2b57744f7950de6245f3b8e43b8e39f616cc77243d043ab496dd56b78
MD5 5e45f80ad3af93cb915211aabc04de64
BLAKE2b-256 05162c7031bec3bec59963142431702cfe5eccde46f8193a7d576164a4cf5558

See more details on using hashes here.

Provenance

The following attestation bundles were made for cebeo_client-0.4.0-py3-none-any.whl:

Publisher: publish.yml on elektriciteit-steen/cebeo-client

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