Action0-Client-OpenAPI
Generate fully typed
action0-client API
clients from an OpenAPI schema: one typed operation class per endpoint,
plus the model classes their results are parsed into. The generated code
is plain, readable action0-client code — it depends on
action0-client only, not on this package — so it runs synchronously,
on asyncio, on Twisted or on an execution model of your own, decided by
the backend you plug in.
uv add --dev action0-client-openapi # or: pip install action0-client-openapi
action0-openapi petstore.json -o src/ # YAML schemas: install the "yaml" extra
src/petstore_client/__init__.py
src/petstore_client/client.py
src/petstore_client/models.py
src/petstore_client/operations.py
src/petstore_client/py.typed
Using the generated client — the backend decides the execution model, and the static types follow it:
from action0.client.backends.requests import RequestsBackend
from petstore_client import GetPet, PetstoreClient
client = PetstoreClient(RequestsBackend(), token="...")
pet = client.send(GetPet(pet_id=42)) # Pet
from action0.client.backends.httpx import AsyncHttpxBackend
client = PetstoreClient(AsyncHttpxBackend(), token="...")
pet = await client.send(GetPet(pet_id=42)) # Awaitable[Pet]
Generated code is meant to be checked in and reviewed like hand-written
code: it is readable, ruff-clean and fully typed — mypy strict, pyright
and ty pass on it. Models become plain dataclasses with generated
JSON converters, endpoints become Operation subclasses, security
schemes become client constructor credentials — with the schema's
descriptions carried along as docstrings and #: doc-comments. The schema support
matrix
lists exactly which OpenAPI 3.0/3.1 constructs are covered — schemas
split over several files are bundled automatically, straight from a URL
too (referenced files download after a per-file confirmation, or with
--download) — and what is deliberately deferred (typed multipart
bodies, per-status response typing, ...).
Requires Python 3.11 or newer.
Full documentation including the API reference: https://laughinjar.github.io/action0-client-openapi/
Development
The project is managed with uv; uv run
syncs the environment automatically:
uv run pytest # tests (incl. doctests in the sources)
uv run ruff check # lint
uv run ruff format # format
uv run mypy # type-check (strict)
uv run pyright # type-check
uv run ty check # type-check
AI disclosure
This library is developed with heavy use of AI coding tools: the code, tests, and documentation are largely written by Claude Code, working from the author's design brief and reviewed by the author. If that changes how much you want to rely on this package, that's a fair call — read the source, it's small.
License
MIT — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file action0_client_openapi-0.1.0.tar.gz.
File metadata
- Download URL: action0_client_openapi-0.1.0.tar.gz
- Upload date:
- Size: 163.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d77618e400f6c37e4dc058c16a426b650ad2aec31aa93f4846c4cab8864279d
|
|
| MD5 |
7f49dc4ca11868f309be2909467d445d
|
|
| BLAKE2b-256 |
fc2ac40b85fbabe25f0bb9edd9251c2f2ea1466d2f19959ee6788c0e4d1860ac
|
Provenance
The following attestation bundles were made for action0_client_openapi-0.1.0.tar.gz:
Publisher:
release.yml on LaughInJar/action0-client-openapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
action0_client_openapi-0.1.0.tar.gz -
Subject digest:
9d77618e400f6c37e4dc058c16a426b650ad2aec31aa93f4846c4cab8864279d - Sigstore transparency entry: 2476027629
- Sigstore integration time:
-
Permalink:
LaughInJar/action0-client-openapi@d1ad1f2962c11af5350860b655e4314fe8ef70b5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/LaughInJar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d1ad1f2962c11af5350860b655e4314fe8ef70b5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file action0_client_openapi-0.1.0-py3-none-any.whl.
File metadata
- Download URL: action0_client_openapi-0.1.0-py3-none-any.whl
- Upload date:
- Size: 51.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e69e142c999aa67586ca22f556b26a4c8483d58896e054a46bf6f6b7e11155f8
|
|
| MD5 |
f315f7770dec9c519bd337a5aa6dedc6
|
|
| BLAKE2b-256 |
b547411617cb221f59005d9ea5f3804af99085edd4e544f50f0cbafa0bcabe04
|
Provenance
The following attestation bundles were made for action0_client_openapi-0.1.0-py3-none-any.whl:
Publisher:
release.yml on LaughInJar/action0-client-openapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
action0_client_openapi-0.1.0-py3-none-any.whl -
Subject digest:
e69e142c999aa67586ca22f556b26a4c8483d58896e054a46bf6f6b7e11155f8 - Sigstore transparency entry: 2476028277
- Sigstore integration time:
-
Permalink:
LaughInJar/action0-client-openapi@d1ad1f2962c11af5350860b655e4314fe8ef70b5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/LaughInJar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d1ad1f2962c11af5350860b655e4314fe8ef70b5 -
Trigger Event:
push
-
Statement type: