ariadne-codegen
Generate fully typed GraphQL client from schema, queries and mutations!
What it is and what it does
Ariadne Code Generator is a command-line tool that reads a GraphQL schema and operation definitions (queries, mutations, subscriptions) and outputs a complete, type-safe Python package. It generates pydantic models for all schema types, inputs, and enums, plus a fully async client class with each operation available as a typed method. You configure it via pyproject.toml, point it at your schema (local file or remote introspection endpoint) and your operations, and it produces a ready-to-import package.
The generated code is fully typed, so your IDE and type checker can catch errors before runtime. It supports both async and sync clients, optional OpenTelemetry tracing, and a custom operation builder for constructing complex queries programmatically. The tool integrates with ruff for code formatting and can be extended via plugins. It's aimed at Python developers building GraphQL-based applications who want to eliminate boilerplate and gain type safety without manual model definition.
Use it for:
- Generate a typed Python client for a public GraphQL API to avoid manual model writing.
- Automate client code generation in a CI/CD pipeline whenever your GraphQL schema changes.
- Build a service that consumes a GraphQL backend with full type checking and IDE autocomplete.
- Create subscription-based real-time clients by generating async methods with websocket support.
- Use the custom operation builder to construct complex, nested GraphQL queries in pure Python.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates fully typed, asynchronous Python GraphQL clients from a schema and query definitions, producing pydantic models and an async client class.
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem—eliminating manual GraphQL client boilerplate while ensuring type safety. It's well-suited for any Python project consuming GraphQL APIs. The permissive BSD-3-Clause license poses no obstacle. Consider it if you want to avoid hand-writing pydantic models and client methods for GraphQL operations.
Install
ariadne-codegen on PyPI
pip
pip install ariadne-codegenuv
uv add ariadne-codegenpoetry
poetry add ariadne-codegenInstalling ariadne-codegen
Before you install
Installs cleanly with low friction; depends on common, well-maintained packages (click, graphql-core, httpx, pydantic, ruff, toml). Actively maintained with recent commits and no known vulnerabilities.
License in practice
BSD-3-Clause is permissive; you can use this package in commercial and proprietary projects with minimal restrictions, provided you include the license notice.
Quickstart
pip install ariadne-codegen
# Add to pyproject.toml:
[tool.ariadne-codegen]
schema_path = "schema.graphql"
queries_path = "queries.graphql"
# Run:
ariadne-codegen
Requires Python 3.10 or later; for subscription support, install the optional websockets dependency via pip install ariadne-codegen[subscriptions].
Verify before relying
- Whether the generated client works seamlessly with all GraphQL server implementations.
- Performance characteristics and overhead of the generated async client under load.
- Compatibility and stability of the plugin system for custom code generation.
- How the custom operation builder integrates with the generated code in practice.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — click, graphql-core, httpx, pydantic, ruff, toml |
| Maintenance | actively maintained — 154 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,706,340/month — #3,633 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ariadne_codegen-0.18.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
ariadneAriadne is a Python library for building…
permissive · top 5,000 on PyPI
graphql-queryBuilds GraphQL query strings programmatically…
permissive · top 15,000 on PyPI
gqlA GraphQL client for Python that executes…
permissive · top 1,000 on PyPI
python-graphql-clientSends GraphQL queries, mutations, and…
permissive · top 15,000 on PyPI
sgqlcsgqlc is a Python client library for querying…
permissive · top 5,000 on PyPI
strawberry-graphql-djangoGenerates GraphQL types, queries, mutations,…
permissive · top 5,000 on PyPI
graphene-pydanticConverts Pydantic models into GraphQL object…
permissive · top 15,000 on PyPI
graphql-coreGraphQL-core is a Python port of the GraphQL.js…
permissive · top 1,000 on PyPI
graphqlclientA lightweight GraphQL client that sends queries…
permissive · top 15,000 on PyPI
hypothesis-graphqlGenerates arbitrary GraphQL queries matching…
permissive · top 5,000 on PyPI