Skip to main content

Action0-Client-OpenAPI

CI PyPI

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

action0_client_openapi-0.1.0.tar.gz (163.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

action0_client_openapi-0.1.0-py3-none-any.whl (51.2 kB view details)

Uploaded Python 3

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

Hashes for action0_client_openapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9d77618e400f6c37e4dc058c16a426b650ad2aec31aa93f4846c4cab8864279d
MD5 7f49dc4ca11868f309be2909467d445d
BLAKE2b-256 fc2ac40b85fbabe25f0bb9edd9251c2f2ea1466d2f19959ee6788c0e4d1860ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for action0_client_openapi-0.1.0.tar.gz:

Publisher: release.yml on LaughInJar/action0-client-openapi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file action0_client_openapi-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for action0_client_openapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e69e142c999aa67586ca22f556b26a4c8483d58896e054a46bf6f6b7e11155f8
MD5 f315f7770dec9c519bd337a5aa6dedc6
BLAKE2b-256 b547411617cb221f59005d9ea5f3804af99085edd4e544f50f0cbafa0bcabe04

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page