Octri

Languages

Python

The Python SDK publishes to PyPI and is async-first, with optional synchronous variants.

Install

bash
pip install your-org-api-client

Options

OptionValuesDefault
Data modeldataclass, pydantic, typeddictdataclass
Sync methodsomit, includeomit
Client stylefunctions, namespaced, class, class-namespacedfunctions
Argument styleobject, positionalobject
Namespacetags, pathtags
Doc commentsfull, minimalfull
File headeromit, includeomit
Usage examplefull, concisefull

Data model

How response models are represented. This is the choice your users feel most.

python
@dataclass
class User:
    id: str

Standard library, no dependencies, no runtime validation. The default.

pydantic if your users already use it, dataclass if you don't know

Runtime validation catches spec drift at the boundary instead of three frames deep. But it's a dependency and a performance cost your users didn't choose. If your consumers are FastAPI shops, pydantic is free. Otherwise the standard library is the polite default.

Sync methods

The generated client is async. include emits synchronous variants alongside, for scripts and notebooks where an event loop is friction.

python
users = client.users.list_sync(limit=10)

Package name

PyPI names are global and normalised: underscores and hyphens are treated the same, case is ignored. Acme_API and acme-api are the same project.

text
acme-api      distribution name (pip install acme-api)
acme_api      import name (import acme_api)
PyPI never lets you reuse a version

Deleting a release does not free its version number. 1.0.0 published once is 1.0.0 forever. See Publishing.

What callers write

python
from acme import AcmeClient

client = AcmeClient(token=os.environ["ACME_TOKEN"])

async for user in client.users.list(limit=100):
    print(user.id)