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.2.tar.gz (178.1 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.2-py3-none-any.whl (57.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: action0_client_openapi-0.1.2.tar.gz
  • Upload date:
  • Size: 178.1 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.2.tar.gz
Algorithm Hash digest
SHA256 f84b8abea266dfd6037979c99eb40b5f9138bff4c4eaeca46bbde43d69e5448a
MD5 98751e7940532842ed890a3565fd42f5
BLAKE2b-256 6cc45e370a04c7ba3dbb9d2d32eb1137ce03fe87942fb182c284d0dea6076841

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for action0_client_openapi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 30a0890999cb9b2e9f91491d9a20013bf0a04f7fefc44424589ae32c7b7e662d
MD5 eb0eb22c3c11dfcdc243e1e9fb54a00d
BLAKE2b-256 3dee2af199376ca742e4ee527e3196d2a07882daadf2d2d02ae6fcfad292e3c4

See more details on using hashes here.

Provenance

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

This release

0.1.2 This release

2 files

0.1.1

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