Metadata-Version: 2.4
Name: motorbay-client
Version: 0.1.0
Summary: Python client for the Motorbay API: Danish vehicle data from Motorstyrelsen's public weekly extract. Generated from the OpenAPI document.
Project-URL: Homepage, https://motorbay.app
Project-URL: Documentation, https://app.motorbay.app/en/docs
License-Expression: MIT
Keywords: api,client,denmark,dmr,motorbay,motorregister,vehicle
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: attrs>=22.2.0
Requires-Dist: httpx<0.29.0,>=0.23.0
Requires-Dist: python-dateutil>=2.8.0
Description-Content-Type: text/markdown

# motorbay-client

Python client for the Motorbay API (Danish vehicle data from Motorstyrelsen's
public weekly extract). `motorbay` is the small wrapper you import.
`motorbay_client` holds the models, generated by openapi-python-client from the
API's OpenAPI document. Python 3.10+.

```sh
pip install motorbay-client
```

```python
from motorbay import MotorbayApiError, MotorbayClient

with MotorbayClient(api_key="mbk_live_...") as motorbay:
    try:
        vehicle = motorbay.lookup_vehicle("AB12345", include=["engine", "inspection"])
        print(vehicle.make.name, vehicle.registration_number)
    except MotorbayApiError as e:
        if e.code == "VehicleNotFound":
            print("No such vehicle")
        elif e.status == 429:
            print(f"Retry in {e.retry_after}s")
        else:
            raise
```

Setup and tests (offline, httpx.MockTransport):

```sh
uv venv .venv && uv pip install -p .venv -r requirements-dev.txt
.venv/bin/python -m pytest -q
```
