--- id: openapi-python-client version: "0.29.0" license: MIT license_treatment: permissive maintenance: active --- # openapi-python-client — Generate modern Python clients from OpenAPI License: permissive · Maintenance: active · Downloads: 3.5M/mo ## What it is and what it does openapi-python-client is a code generator that reads OpenAPI 3.0 and 3.1 specifications and produces a complete, modern Python HTTP client library. It uses Jinja2 templates and outputs type-annotated models, endpoint functions organized by tag, and both plain and authenticated client classes. The generated code includes a pyproject.toml, README, and optional post-generation hooks (via ruff) for formatting and linting. The tool is designed for Python developers who want to avoid hand-writing boilerplate HTTP client code. It depends on attrs, httpx, pydantic, ruamel-yaml, jinja2, typer, colorama, shellingham, and ruff. The project is actively maintained but explicitly notes it is still in development and does not support all OpenAPI features; it also does not support OpenAPI 2.x (Swagger). Use it for: - Generate a typed Python client library from a published OpenAPI spec to avoid manual HTTP boilerplate and ensure type safety. - Automate client updates when an API's OpenAPI spec changes, regenerating models and endpoint functions without hand-editing. - Create multiple client libraries from different OpenAPI documents using custom Jinja2 templates to match your project's code style. - Integrate client generation into a CI/CD pipeline to keep generated clients in sync with API specifications. - Override model class names and customize generated code structure via YAML configuration for non-standard API schemas. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates type-annotated Python HTTP clients from OpenAPI 3.0 and 3.1 specifications, producing ready-to-use client libraries with models, API functions, and authentication support. Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real problem—eliminating hand-written HTTP client boilerplate for OpenAPI-documented APIs. The MIT license is permissive. Trade-off: it is still in beta and does not support all OpenAPI features; verify that your API's spec is compatible before committing to it in production workflows. ## Install pip install openapi-python-client uv add openapi-python-client poetry add openapi-python-client ## Installing openapi-python-client Before you install: Low friction install with a pure-Python wheel. Active maintenance (last commit 2026-08-13), 1980 repository stars, and no known vulnerabilities. Requires Python 3.11 or later. Recommended installation via pipx with --include-deps to ensure ruff is available for post-generation code cleanup. License in practice: MIT license (permissive) means you can use generated clients freely in commercial and private projects with minimal restrictions. No license compatibility concerns for typical Python development workflows. Quickstart: pip install openapi-python-client openapi-python-client generate --url https://api.example.com/openapi.json # Generates a client library with Client class, API functions, and models Requires Python 3.11 or later. For full functionality (code formatting), install with pipx and --include-deps flag so ruff is available in your PATH. Verify before relying: - Extent of OpenAPI feature coverage beyond the note that 'not all OpenAPI features' are supported—which specific features are missing or incomplete - Performance characteristics when generating clients from very large OpenAPI documents - Stability of the custom template API, given the description notes it is 'beta-level' and 'undocumented and unstable' ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags openapi client generator python, generate python http client from openapi, openapi 3.0 3.1 python codegen, typed python api client generator, openapi spec to python client, rest api client code generation, openapi python code generator, code-generation, openapi, rest-api [View on SkillFed](https://skillfed.io/packages/openapi-python-client) · [View on PyPI](https://pypi.org/project/openapi-python-client/)