Metadata-Version: 2.4
Name: easybill-client
Version: 0.1.0
Summary: Python easybill REST API client with Pydantic models and webhook helpers
Author: GitHub Copilot
Requires-Python: >=3.11
Requires-Dist: httpx<1,>=0.27
Requires-Dist: pydantic<3,>=2.8
Provides-Extra: dev
Requires-Dist: pytest-asyncio<1,>=0.24; extra == 'dev'
Requires-Dist: pytest<9,>=8.3; extra == 'dev'
Description-Content-Type: text/markdown

# easybill client

Python client for the easybill REST API with a generated API layer, Pydantic-based convenience models, and webhook parsing helpers for middleware integration.

## Current status

The initial implementation is in place and includes:

- a project scaffold with packaging and tests
- sync and async wrapper clients
- authentication helpers for bearer and basic auth
- typed Pydantic facades for customers, documents, positions, and document payments
- pagination helpers and basic retry handling for HTTP 429 rate limits
- a webhook parser for JSON and form payloads
- a reproducible generation script based on the provided Swagger specification

## Development

Install the local project dependencies and run the tests:

```powershell
python -m pytest -q
```

Generate the raw clients from the API description:

```powershell
python scripts/generate_client.py --mode both
```

## Usage

```python
from easybill_client import EasybillClient

with EasybillClient(api_key="YOUR_API_TOKEN", max_retries=2, retry_backoff=1.0) as client:
    customer_page = client.list_customers(limit=50)
    position = client.get_position(5)
    payment = client.create_document_payment(document_id=10, amount=1999, reference="INV-10")

    for customer in client.iter_all_customers(limit=100):
        print(customer.id, customer.company_name)
```

## Structure

- `src/easybill_client`: public package and middleware-friendly helpers
- `tests`: focused verification for auth and webhook behavior
- `scripts/generate_client.py`: generation entrypoint for the raw REST layer
- `generated`: generated sync and async clients derived from the Swagger description
