// the find
openapi-generators/openapi-python-client
Generate modern Python clients from OpenAPI
A Python code generator that takes an OpenAPI 3.x spec and produces a typed Python client library using dataclasses and httpx. Targets developers who want a pip-installable generator written in Python rather than the Java-based openapi-generator behemoth. Generated code is fully typed and passes mypy.
The generated client is genuinely modern Python — dataclasses, proper type annotations, httpx under the hood, no requests/urllib2 cruft. The Jinja2 template override system is well-designed: you only need to copy the templates you want to change, not fork the whole generator. The golden-record end-to-end tests are a good pattern — if the generator output drifts, you see it immediately in a diff rather than chasing runtime bugs. OpenAPI 3.1 support is there, which most generators still fumble on.
The README itself admits 'this project does not support all OpenAPI features,' and it means it — complex oneOf/anyOf nesting, discriminator patterns, and recursive schemas can silently produce wrong or incomplete output rather than erroring clearly. The custom templates feature is explicitly flagged as beta with an unstable internal API, meaning an upgrade can silently break your templates with no migration path. Authentication support is thin: you get Client and AuthenticatedClient with a token, but OAuth flows, API key variants, and multi-auth schemes require hand-editing the generated code. Async support exists but is a separate generated method per endpoint, doubling the surface area you have to audit when specs change.