Metadata-Version: 2.4
Name: ridesafety-sdk
Version: 0.1.0
Summary: RideSafety Developer API SDK
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31

# RideSafety Python SDK

## Install

```bash
pip install ridesafety-sdk
```

## Build & publish

```bash
cd sdk/python
python3 -m pip install --upgrade build twine
python3 -m build
python3 -m twine upload dist/*
```

## Usage

```python
from ridesafety_sdk import RideSafetyClient

client = RideSafetyClient(
    api_key="YOUR_API_KEY",
    base_url="https://ridesafety.app",
)

recalls = client.get_recalls(vin="1HGBH41JXMN109186")

diagnostics = client.run_diagnostics(
    vin="1HGBH41JXMN109186",
    symptoms="Rough idle and engine misfire",
    dtc_codes=["P0300"],
)

safety = client.get_safety_ratings(make="Honda", model="Civic", year=2020)
```

## Smoke test (all APIs)

```bash
cd sdk/python
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
python smoke_test.py
```

Edit `smoke_test.py` to set your API key. Diagnostics may require a paid plan and can return 402.

## Auth modes

By default the SDK uses `Authorization: Bearer <key>`. To use `x-api-key` instead:

```python
client = RideSafetyClient(api_key="KEY", auth_mode="x-api-key")
```
