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.2.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.2.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cebeo_client-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 afcea8b8da5047c21b489168093e9bb7e986db450845c4f611258f18cb566fed
MD5 0da2794d79c4f873effff57e19349364
BLAKE2b-256 9c8571727b913e2ef7a4da816d3eb5783cffc672d6920b04dc90b711fab717e6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cebeo_client-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b993e05fa2bd0b5d543d3527a28a7eee56db9d327b4efccd87c949357a6ac5e5
MD5 3aea99ca0bbcf890491ca5dc78d0e678
BLAKE2b-256 509de5594a95ed21b88da0abe1bb43e15903a2eacdaa5272c2ee505f5187265e

See more details on using hashes here.

Provenance

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