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.3.0.tar.gz (10.9 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.3.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cebeo_client-0.3.0.tar.gz
  • Upload date:
  • Size: 10.9 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.3.0.tar.gz
Algorithm Hash digest
SHA256 8c1f5ba66a5217500ca3e033466227632218bcd4c03d77122aa3fe107ad00d63
MD5 5580aa9b7501f077fbbfd67793852fb9
BLAKE2b-256 2855cb9aea51e6ede126349ca5585317b89f80973aa0f4dd1e18ce5f8dd29d62

See more details on using hashes here.

Provenance

The following attestation bundles were made for cebeo_client-0.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: cebeo_client-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17140250a90d39ee8d5beeab7c0420b35095a54518ae797cbf9519de0e26fe50
MD5 66cf0bc277e075a9a4b0cdbd00f6d460
BLAKE2b-256 38cf77a6e720974c54df593545912a0bd037f25f5f329d8f199093cf874c3600

See more details on using hashes here.

Provenance

The following attestation bundles were made for cebeo_client-0.3.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