Metadata-Version: 2.5
Name: yertle-client
Version: 0.2.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:** published on PyPI. Generated with [`openapi-python-client`](https://github.com/openapi-generators/openapi-python-client) from the backend's OpenAPI spec.

## Install

```bash
pip install yertle-client
```

The `yertle_client/` directory in this repo is **not committed** — it's regenerated fresh at publish time from the backend's OpenAPI spec (see `.github/workflows/publish-client.yml`). See [Local development](#local-development) below if you need the code on your machine.

## Usage

```python
from yertle_client import AuthenticatedClient
from yertle_client.api.organizations import list_organizations_orgs_get

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

For a higher-level ergonomic wrapper (`import yertle; yertle.orgs.list()`), install the SDK facade instead:

```bash
pip install yertle
```

`yertle` depends on `yertle-client` transitively — installing it pulls both.

## Local development

The `clients/python/yertle_client/` directory is `.gitignore`'d because it's autogenerated. If you need the code locally (for example, to test not-yet-published spec changes against `yertle-python`), regenerate it:

```bash
# From the repo root:
make regen-client        # dumps OpenAPI from local backend, then regens

# Or invoke the script directly for spec-source overrides:
bash clients/python/generate.sh                                     # dump from local backend
OPENAPI_PATH=/path/to/spec.json bash clients/python/generate.sh     # use a local spec file
OPENAPI_URL=http://localhost:8000/openapi.json bash clients/python/generate.sh  # fetch from URL
```

Then install it into your yertle-python checkout for testing:

```bash
# In yertle-python:
uv pip install -e ../yertle/clients/python --force-reinstall
```

See `docs/notes/features/yertle-python/PACKAGING.md` "Local dev workflow" (in the backend repo) for the full playbook.

## Layout

| Path | Source | Notes |
|---|---|---|
| `yertle_client/api/` | generated (gitignored) | one module per API route |
| `yertle_client/models/` | generated (gitignored) | request/response models (attrs-based) |
| `yertle_client/client.py` | generated (gitignored) | `Client` and `AuthenticatedClient` |
| `openapi-config.yaml` | hand-written (tracked) | codegen options (package name, naming) |
| `generate.sh` | hand-written (tracked) | regeneration script |
| `pyproject.toml` | hand-written (tracked) | package metadata + build config |
| `README.md` | hand-written (tracked) | this file |
