Generate modern, type-annotated Python client libraries from OpenAPI 3.0 and 3.1 specifications.
openapi-python-client is a Python tool that automatically generates modern, type-annotated client libraries from OpenAPI 3.0 and 3.1 specifications. It solves the problem of manually writing API clients by producing ready-to-use Python modules with models, API functions, and authentication classes. The generated code is designed to be clean, maintainable, and leverage the latest Python features.
Python developers and teams who need to interact with REST APIs described by OpenAPI specifications and want an automated, customizable way to generate type-safe client SDKs.
Developers choose this tool because it's written in Python, making it easy to install and extend, and it focuses on generating high-quality, modern Python code with extensive configuration options. Unlike some generators, it provides a tailored experience for Python developers with features like custom templates and post-generation formatting.
Generate modern Python clients from OpenAPI
Generates clients using Python type annotations, dataclasses, and enums, ensuring robust and maintainable code as highlighted in the README's focus on 'latest and greatest Python features'.
Supports custom Jinja2 templates via the --custom-template-path flag, allowing developers to tailor generated code structure and style without overriding all templates.
Offers extensive YAML/JSON configuration for class names, package metadata, enums, and post-generation hooks, enabling fine-tuned control over the generated client.
Automatically runs Ruff for code formatting via post_hooks and supports multiple package managers (Poetry, PDM, setup.py), fitting into modern Python workflows.
The README explicitly states 'This project is still in development and does not support all OpenAPI features,' limiting its use for complex or advanced APIs.
Custom templates are labeled a 'beta-level feature' with an 'undocumented and unstable' API, posing risks for teams relying on deep customization.
Requires pipx with --include-deps for optimal installation to ensure Ruff is available, adding an extra step compared to simpler, all-in-one tools.
Full stack, modern web application template. Using FastAPI, React, SQLModel, PostgreSQL, Docker, GitHub Actions, automatic HTTPS and more.
Feature rich robust FastAPI template.
🚀 Cookiecutter Template for FastAPI + React Projects. Using PostgreSQL, SQLAlchemy, and Docker
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.