Generate idiomatic Python clients and models from OpenAPI/Swagger specifications.
Pydantic v2 models and an async httpx client — typed, with optional docstrings, validation, and camelCase field aliases.
No .NET required. Unlike most MetaEngine wrappers, each wheel bundles a self-contained, platform-native binary —
pip installand run. There is nothing else to install.
- PyPI Package: metaengine-openapi-httpx
- NuGet Package: MetaEngine.Python.OpenApi.Httpx
- Website: metaengine.eu
- ✅ Self-contained - Bundled native binary per platform; no .NET runtime to install
- ✅ Pydantic v2 models -
BaseModelwithConfigDict, typed fields, required vs optional - ✅ Async httpx client - One service class per OpenAPI tag,
model_validateon responses - ✅ camelCase aliases - snake_case Python properties mapped to camelCase wire names via
Field(alias=...) - ✅ Enums - Standalone Python enum types, properly serialized
- ✅ Docstrings - Optional doc-comment generation from OpenAPI descriptions and examples
- ✅ Tag Filtering - Generate only the operations you need
- ✅ Options Object - Collapse long parameter lists into an options object past a threshold
pip install metaengine-openapi-httpxPre-built wheels are published for Linux (x86_64, aarch64), macOS (Apple Silicon + Intel), and Windows (x64).
- Python 3.8 or later
- No .NET runtime - the wheel ships a self-contained native binary for your platform
metaengine-openapi-httpx <input> <output> [options]metaengine-openapi-httpx api.yaml ./generated \
--camel-case-aliases \
--documentation# From a URL
metaengine-openapi-httpx https://api.example.com/openapi.json ./generated
# Filter by OpenAPI tags
metaengine-openapi-httpx api.yaml ./generated --include-tags orders,users
# Strict spec validation + verbose logging
metaengine-openapi-httpx api.yaml ./generated --strict-validation --verbose| Argument / Option | Description | Default |
|---|---|---|
input (required) |
OpenAPI specification file path or URL | - |
output (required) |
Output directory for generated Python files | - |
--include-tags <tags> |
Only generate operations with these tags (comma-separated) | - |
--service-suffix <name> |
Service class naming suffix | Service |
--options-threshold <n> |
Parameter count at which a method switches to an options object | 4 |
--camel-case-aliases |
Generate camelCase field aliases for Pydantic models | false |
--documentation |
Generate docstring comments | false |
--strict-validation |
Enable strict OpenAPI validation | false |
--verbose |
Enable verbose logging | false |
output/
├── models/ # One file per schema (Pydantic v2)
│ ├── order.py # class Order(BaseModel): ...
│ ├── order_status.py # standalone enum type
│ └── ...
└── services/ # One async httpx client per tag
├── orders_service.py # class OrdersService with all order operations
└── ...
Models use Pydantic v2 (BaseModel + ConfigDict); with --camel-case-aliases, snake_case
properties carry a Field(alias=...) mapping to the wire name and populate_by_name=True:
class Order(BaseModel):
model_config = ConfigDict(populate_by_name=True)
id: int
customer_name: str = Field(alias='customerName')
total_amount: float | None = Field(default=None, alias='totalAmount')- Issues: GitHub Issues
- Email: info@metaengine.eu
- Website: metaengine.eu
MIT License - see LICENSE file for details.
This is the documentation and issue tracking repository for MetaEngine OpenAPI Python httpx. The package is published to PyPI.
Source code is proprietary, but the package is free to use under the MIT license.