Metadata-Version: 2.5
Name: xapikorea
Version: 0.1.0
Summary: Official Python SDK for the XAPI Korea API
Project-URL: Homepage, https://xapikorea.com
Project-URL: Documentation, https://github.com/xapiauto/xapikorea-python#readme
Project-URL: Issues, https://github.com/xapiauto/xapikorea-python/issues
Project-URL: Repository, https://github.com/xapiauto/xapikorea-python
Author: XAPI Korea
License-Expression: MIT
License-File: LICENSE
Keywords: automotive,korea,sdk,vehicles,xapi-korea
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Provides-Extra: dev
Requires-Dist: build<2,>=1.2; extra == 'dev'
Requires-Dist: pytest<10,>=8; extra == 'dev'
Requires-Dist: twine<8,>=7; extra == 'dev'
Description-Content-Type: text/markdown

# XAPI Korea Python

Python client for the XAPI Korea API. The current version supports account
information, vehicle search, vehicle details and inspection history.

## Installation

Python 3.10 or newer is required.

```bash
python -m pip install xapikorea
```

## Development setup

```bash
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .
```

For development, install the test and build tools:

```bash
python -m pip install -e ".[dev]"
python -m pytest
python -m build
```

## Usage

```python
import os

from xapikorea import XAPIKorea


with XAPIKorea(os.environ["XAPIKOREA_API_KEY"]) as client:
    account = client.me()

print(account.email, account.plan)
```

Search the current inventory:

```python
with XAPIKorea(os.environ["XAPIKOREA_API_KEY"]) as client:
    results = client.search(
        brand="hyundai",
        year_from=2022,
        price_max=30_000_000,
        limit=5,
    )

for car in results.results:
    print(car.manufacturer, car.model, car.price_krw)
```

Retrieve full vehicle details and photos:

```python
with XAPIKorea(os.environ["XAPIKOREA_API_KEY"]) as client:
    car = client.get_car(42662587)

print(car.manufacturer, car.model, car.price_krw)
print(*car.photos, sep="\n")
```

Retrieve the vehicle's inspection report:

```python
with XAPIKorea(os.environ["XAPIKOREA_API_KEY"]) as client:
    inspection = client.get_inspection(42662587)

if not inspection.available:
    print("No inspection sheet is available")
elif inspection.had_accident:
    print("The inspection sheet reports accident history")
else:
    print("No accident history reported on the inspection sheet")
```

Use `base_url` to point the client at a local API:

```python
client = XAPIKorea("enc_test_key", base_url="http://localhost:8000")
```

## License

This project is licensed under the [MIT License](https://github.com/xapiauto/xapikorea-python/blob/main/LICENSE).

## Support

For bugs and feature requests, [open a GitHub issue](https://github.com/xapiauto/xapikorea-python/issues).
