Metadata-Version: 2.5
Name: yertle-client
Version: 0.1.0
Summary: Auto-generated Python client for the Yertle API.
Project-URL: Homepage, https://github.com/model-context/yertle-python
Project-URL: Repository, https://github.com/model-context/yertle-python
Author: Yertle
License: MIT
Keywords: api,client,yertle
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.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Requires-Dist: attrs>=23.2
Requires-Dist: httpx<1,>=0.27
Requires-Dist: python-dateutil>=2.8
Description-Content-Type: text/markdown

# yertle-client

Auto-generated Python client for the [Yertle](https://yertle.com) API.

> **Status:** alpha (`0.0.1`). Generated with [`openapi-python-client`](https://github.com/openapi-generators/openapi-python-client) from the backend's OpenAPI spec.

## Install

```bash
# Not yet on PyPI. Install from this repo:
pip install -e clients/python/
```

## Usage

```python
from yertle_client.auth import client_from_token
from yertle_client.api.organizations import list_organizations_orgs_get

client = client_from_token(
    token="<JWT or PAT>",
    base_url="https://api.yertle.com",
)
orgs = list_organizations_orgs_get.sync(client=client)
for org in orgs or []:
    print(org.id, org.name)
```

The package re-exports `Client` and `AuthenticatedClient` from the top level for direct use, but `client_from_token` is the recommended entry point.

## Regeneration

```bash
./generate.sh                                                 # dump from local backend, then regen
OPENAPI_PATH=/path/to/spec.json ./generate.sh                 # use a local spec file
OPENAPI_URL=http://localhost:8000/openapi.json ./generate.sh  # fetch from a running backend
```

## Layout

| Path | Source | Notes |
|---|---|---|
| `yertle_client/api/` | generated | one module per API route |
| `yertle_client/models/` | generated | request/response models (attrs-based) |
| `yertle_client/client.py` | generated | `Client` and `AuthenticatedClient` |
| `yertle_client/auth.py` | **hand-written** | `client_from_token` helper. May be wiped by regeneration — restore from git. |
| `openapi-config.yaml` | hand-written | codegen options (package name, naming) |
| `generate.sh` | hand-written | regeneration script |
