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.1.tar.gz (169.3 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.1-py3-none-any.whl (53.5 kB view details)

Uploaded Python 3

File details

Details for the file action0_client_openapi-0.1.1.tar.gz.

File metadata

  • Download URL: action0_client_openapi-0.1.1.tar.gz
  • Upload date:
  • Size: 169.3 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.1.tar.gz
Algorithm Hash digest
SHA256 21f283b5f14519ae9e699cf61fc57f772e3ac2e1a0707bf5e5a8e30dd7d21e58
MD5 1f4c9bba6e012ca85f5bbbdbb89a1ea1
BLAKE2b-256 640b74a7e3463448b7fd35d19321a1887e291af1019c828450e60278ff20f02d

See more details on using hashes here.

Provenance

The following attestation bundles were made for action0_client_openapi-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for action0_client_openapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 172c560e76443813254277441a2ec2cf399256b699d8fa67077f3240ae8420bb
MD5 b7140a7e547297111fe47db3f346faa8
BLAKE2b-256 d031f6671b876d16cba58ef661b7cceb57d887bde49eea11a16b6b9e95c2f70b

See more details on using hashes here.

Provenance

The following attestation bundles were made for action0_client_openapi-0.1.1-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

This release

0.1.1 This release

2 files

0.1.0

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