Generate idiomatic Python (Pydantic v2 + httpx) clients and models from GraphQL schemas. Self-contained — no .NET install required.
Project description
metaengine-graphql-httpx
Generate idiomatic Python clients and models from a GraphQL schema (SDL) —
Pydantic v2 models and an async httpx client, with bearer/basic auth, retries,
timeouts, error handling, custom headers, fragments, @oneOf inputs, and optional docstrings.
Powered by MetaEngine. The wheel is self-contained: it bundles a platform-native runner, so no .NET installation is required.
Install
pip install metaengine-graphql-httpx
Usage
metaengine-graphql-httpx <input> <output> [options]
| Argument / Option | Description |
|---|---|
input |
GraphQL schema file path (SDL) or inline SDL content |
output |
Output directory for generated Python files |
--fragments |
Emit reusable named fragments for object-type selections |
--one-of-inputs |
Generate idiomatic @oneOf input types (tagged-union inputs) |
--custom-scalar <Scalar>=<target> |
Map a GraphQL custom scalar to a Python type (repeatable). Targets: str, int, float, bool, datetime, Any |
--bearer-auth <ENV> |
Bearer token from env var (e.g. API_TOKEN) |
--basic-auth <USER_ENV>=<PASS_ENV> |
Basic auth from env vars |
--retries <n> |
Enable retries with exponential backoff; value sets max attempts |
--timeout <s> |
Request timeout in seconds for all operations |
--error-handling |
Smart error handling based on HTTP status semantics |
--custom-header <Header>=<ENV> |
Static header from env var (repeatable) |
--base-url-env <ENV> |
Environment variable name for base URL (default: API_BASE_URL) |
--sync-methods |
Generate synchronous service methods alongside the async client |
--middleware |
Generate httpx transport middleware infrastructure |
--documentation |
Generate docstring comments from SDL descriptions |
--camel-case-aliases |
Generate camelCase field aliases for Pydantic models |
--options-threshold <n> |
Parameter count at which a method switches to an options object (default: 4) |
--service-suffix <name> |
Service naming suffix (default: Service) |
--verbose |
Enable verbose logging |
Example
metaengine-graphql-httpx ./schema.graphql ./generated --fragments --documentation --retries 3
Supported platforms
Pre-built wheels are published for Linux (x86_64, aarch64), macOS (Apple Silicon + Intel), and Windows (x64).
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaengine_graphql_httpx-1.0.0-py3-none-win_amd64.whl.
File metadata
- Download URL: metaengine_graphql_httpx-1.0.0-py3-none-win_amd64.whl
- Upload date:
- Size: 30.1 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f302e313e8ba7c795b16b709c49045fbb243e18d1763f99c8b4e3e96a913659
|
|
| MD5 |
2e7dc66d621c121e6f19c54b93f7c8a5
|
|
| BLAKE2b-256 |
5f5c451a995ebf89c64ce90ebe0929fe1fcf433dbbe0857f94ae4ca4df204334
|
File details
Details for the file metaengine_graphql_httpx-1.0.0-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: metaengine_graphql_httpx-1.0.0-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 29.7 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc054e50854407832c6b755f8ff1e19ed7624e6b879ff02119b7b91c1838e08c
|
|
| MD5 |
e7fb43da64fda721d40d42c5f9edc0ba
|
|
| BLAKE2b-256 |
2b765c95ca5de2432115f15c2ac6bf71dd905cc47b193bdb826b0f6e7f764e53
|
File details
Details for the file metaengine_graphql_httpx-1.0.0-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: metaengine_graphql_httpx-1.0.0-py3-none-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 28.5 MB
- Tags: Python 3, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73c84432d222f26c8507e1f5fa10b1fc8856e2d93f32ca618b883457cace040a
|
|
| MD5 |
076ac1bc834369c6fb167bdde75d9e08
|
|
| BLAKE2b-256 |
14b84fe419b4db561d5ed93746ca3aaf7cb447a877d4ab520a9e3d96b0a366cd
|
File details
Details for the file metaengine_graphql_httpx-1.0.0-py3-none-macosx_11_0_x86_64.whl.
File metadata
- Download URL: metaengine_graphql_httpx-1.0.0-py3-none-macosx_11_0_x86_64.whl
- Upload date:
- Size: 30.1 MB
- Tags: Python 3, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
721c77a5636825597d8bead2e9e5c2761848983d0ecca1408866c631a6cb73a8
|
|
| MD5 |
63867e2ea42daa7602148404f698c498
|
|
| BLAKE2b-256 |
9f5fb66ace950243851863822b9086eaef22a7187d880cc5706d0fb21bd9e4b5
|
File details
Details for the file metaengine_graphql_httpx-1.0.0-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: metaengine_graphql_httpx-1.0.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 28.7 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76b8af42018e3f21426faec643771945a4ed6d16fa06e38e5ecab1ae58fac5f1
|
|
| MD5 |
30143d086244496a3a6741bd15a76a9b
|
|
| BLAKE2b-256 |
2f3739d9cf8db17886cc8f4357b0658174e4fdbaac40c1e6e978defd643318b9
|