Metadata-Version: 2.4
Name: cebeo-client
Version: 0.2.0
Summary: Python client for Cebeo B2B XML API
Project-URL: Homepage, https://github.com/elektriciteit-steen/cebeo-client
Project-URL: Repository, https://github.com/elektriciteit-steen/cebeo-client
Author-email: Steen Elektriciteit <dev@steen.be>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: requests>=2.28.0
Provides-Extra: dev
Requires-Dist: pre-commit>=3.6.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: responses>=0.23.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# cebeo-client

Python client for Cebeo's B2B XML API.

## Installation

```bash
pip install cebeo-client
```

## Usage

```python
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

```python
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

```python
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

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

# Run tests
pytest

# Run linter
ruff check src tests
```

## License

MIT
