--- id: ariadne-codegen version: "0.18.0" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # ariadne-codegen — Generate fully typed GraphQL client from schema, queries and mutations! License: permissive · Maintenance: active · Downloads: 1.7M/mo ## 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 above — 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 pip install ariadne-codegen uv add ariadne-codegen poetry add ariadne-codegen ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 1.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags graphql client code generator, python graphql codegen, typed graphql client, async graphql python, graphql schema to python, pydantic graphql models, graphql query client generator, graphql, code-generation, async-client [View on SkillFed](https://skillfed.io/packages/ariadne-codegen) · [View on PyPI](https://pypi.org/project/ariadne-codegen/)