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.1.0.tar.gz (9.3 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.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cebeo_client-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 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.1.0.tar.gz
Algorithm Hash digest
SHA256 860dc66a26a5490d13deb3a13d7e779fe97cb485042c55269e24786f63a0d461
MD5 a9d6e595f5e8b420a275e2b76e910511
BLAKE2b-256 68008b3959254403679bdd20d4daa577c5094227c8e28005264ee2926e831efb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: cebeo_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac23863b3f994ed8762c73ca9dbd3cbaf401f319f7d3f404ff10d4cc8c3e86bd
MD5 34c6a84d8e4c57279122ad8bd43e1319
BLAKE2b-256 e40a40188b0f46cef4d536ff394fe11aa252f0b5bdadfe9f55404f619c30d88d

See more details on using hashes here.

Provenance

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