Metadata-Version: 2.4
Name: ariadne
Version: 1.1.0a3
Summary: Ariadne is a Python library for implementing GraphQL servers.
Project-URL: Homepage, https://ariadnegraphql.org/
Project-URL: Repository, https://github.com/mirumee/ariadne
Project-URL: Bug Tracker, https://github.com/mirumee/ariadne/issues
Project-URL: Community, https://github.com/mirumee/ariadne/discussions
Project-URL: Twitter, https://twitter.com/AriadneGraphQL
Author-email: Mirumee Software <ariadne@mirumee.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Keywords: api,asgi,asyncio,dataloaders,django,fastapi,federation,flask,graphql,opentelemetry,relay,schema,schema-first,sdl,sse,starlette,subscriptions,tracing,websockets,wsgi
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: graphql-core>=3.2.0
Requires-Dist: starlette<2.0,>0.17
Requires-Dist: typing-extensions>=4.6.0
Provides-Extra: asgi-file-uploads
Requires-Dist: python-multipart>=0.0.13; extra == 'asgi-file-uploads'
Provides-Extra: dev
Requires-Dist: ipdb; extra == 'dev'
Provides-Extra: sqlalchemy
Requires-Dist: aiodataloader>=0.2.0; extra == 'sqlalchemy'
Requires-Dist: sqlalchemy>=2.0.0; extra == 'sqlalchemy'
Provides-Extra: telemetry
Requires-Dist: opentelemetry-api; extra == 'telemetry'
Provides-Extra: test
Requires-Dist: aiodataloader; extra == 'test'
Requires-Dist: freezegun; extra == 'test'
Requires-Dist: graphql-sync-dataloaders; extra == 'test'
Requires-Dist: httpx; extra == 'test'
Requires-Dist: opentelemetry-api; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-asyncio; extra == 'test'
Requires-Dist: pytest-benchmark; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-mock; extra == 'test'
Requires-Dist: python-multipart>=0.0.13; extra == 'test'
Requires-Dist: syrupy; extra == 'test'
Requires-Dist: werkzeug; extra == 'test'
Provides-Extra: types
Requires-Dist: ty>=0.0.15; extra == 'types'
Description-Content-Type: text/markdown

[![Ariadne](https://ariadnegraphql.org/img/logo-horizontal-sm.png)](https://ariadnegraphql.org)

[![Documentation](https://img.shields.io/badge/docs-ariadnegraphql.org-brightgreen.svg)](https://ariadnegraphql.org)
[![codecov](https://codecov.io/github/mirumee/ariadne/graph/badge.svg?token=8GSRgVxHd7)](https://codecov.io/github/mirumee/ariadne)
![PyPI - Version](https://img.shields.io/pypi/v/ariadne)
![PyPI - Downloads](https://img.shields.io/pypi/dm/ariadne)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ariadne)

- - - - -

# Ariadne

Ariadne is a Python library for implementing [GraphQL](http://graphql.github.io/) servers.

- **Schema-first:** Ariadne enables Python developers to use schema-first approach to the API implementation. This is the leading approach used by the GraphQL community and supported by dozens of frontend and backend developer tools, examples, and learning resources. Ariadne makes all of this immediately available to you and other members of your team.
- **Simple:** Ariadne offers small, consistent and easy to memorize API that lets developers focus on business problems, not the boilerplate.
- **Open:** Ariadne was designed to be modular and open for customization. If you are missing or unhappy with something, extend or easily swap with your own.

Documentation is available [here](https://ariadnegraphql.org).

## Ariadne ecosystem

| Repository | Description |
| ---------- | ----------- |
| [Ariadne](https://github.com/mirumee/ariadne) | Python library for implementing GraphQL servers using a schema-first approach. |
| [Ariadne codegen](https://github.com/mirumee/ariadne-codegen) | GraphQL client code generator for Python. |
| [Ariadne auth](https://github.com/mirumee/ariadne-auth) | A collection of authentication and authorization utilities for Ariadne. |
| [Ariadne lambda](https://github.com/mirumee/ariadne-lambda) | Deploy Ariadne GraphQL applications as AWS Lambda functions. |
| [Ariadne GraphQL proxy](https://github.com/mirumee/ariadne-graphql-proxy) | A GraphQL proxy for Ariadne that allows you to combine multiple GraphQL APIs into a single API. |


## Features

- Simple, quick to learn and easy to memorize API.
- Queries, mutations and input types.
- Asynchronous resolvers and query execution.
- Subscriptions (async and sync generators, with customizable handlers).
- Custom scalars, enums and schema directives.
- Unions and interfaces.
- File uploads.
- Defining schema using SDL strings.
- Loading schema from `.graphql`, `.gql`, and `.graphqls` files.
- ASGI and WSGI support, with integrations for Django, FastAPI, Flask, and Starlette.
- Opt-in automatic resolvers mapping between `camelCase123` and `snake_case_123`.
- Automated integration with **SQLAlchemy 2.0** for zero-boilerplate resolvers and N+1 prevention.
- [OpenTelemetry](https://opentelemetry.io/) extension for API monitoring.
- Built-in [GraphiQL](https://github.com/graphql/graphiql) explorer for development and testing.
- GraphQL syntax validation via `gql()` helper function.
- No global state or object registry, support for multiple GraphQL APIs in same codebase with explicit type reuse.
- Support for [Apollo Federation](https://www.apollographql.com/docs/federation/).


## Installation

Ariadne can be installed with pip:

```console
pip install ariadne
```

Ariadne requires Python 3.10 or higher (up to 3.14).


## Quickstart

The following example creates an API defining `Person` type and single query field `people` returning a list of two persons. It also starts a local dev server with [GraphiQL](https://github.com/graphql/graphiql) available on the `http://127.0.0.1:8000` address.

Start by installing [uvicorn](http://www.uvicorn.org/), an ASGI server we will use to serve the API:

```console
pip install uvicorn
```

Then create an `example.py` file for your example application:

```python
from ariadne import ObjectType, QueryType, gql, make_executable_schema
from ariadne.asgi import GraphQL

# Define types using Schema Definition Language (https://graphql.org/learn/schema/)
# Wrapping string in gql function provides validation and better error traceback
type_defs = gql("""
    type Query {
        people: [Person!]!
    }

    type Person {
        firstName: String
        lastName: String
        age: Int
        fullName: String
    }
""")

# Map resolver functions to Query fields using QueryType
query = QueryType()

# Resolvers are simple python functions
@query.field("people")
def resolve_people(*_):
    return [
        {"firstName": "John", "lastName": "Doe", "age": 21},
        {"firstName": "Bob", "lastName": "Boberson", "age": 24},
    ]


# Map resolver functions to custom type fields using ObjectType
person = ObjectType("Person")

@person.field("fullName")
def resolve_person_fullname(person, *_):
    return "%s %s" % (person["firstName"], person["lastName"])

# Create executable GraphQL schema
schema = make_executable_schema(type_defs, query, person)

# Create an ASGI app using the schema, running in debug mode
app = GraphQL(schema, debug=True)
```

Finally run the server:

```console
uvicorn example:app
```

For more guides and examples, please see the [documentation](https://ariadnegraphql.org).

## Versioning policy ##
`ariadne` follows [Semantic Versioning](https://semver.org/).


## Contributing

We are welcoming contributions to Ariadne! If you've found a bug or issue, feel free to use [GitHub issues](https://github.com/mirumee/ariadne/issues). If you have any questions or feedback, don't hesitate to catch us on [GitHub discussions](https://github.com/mirumee/ariadne/discussions/).

For guidance and instructions, please see [CONTRIBUTING.md](CONTRIBUTING.md).

Website and the docs have their own GitHub repository: [mirumee/ariadne-website](https://github.com/mirumee/ariadne-website)

**Crafted with ❤️ by [Mirumee Software](http://mirumee.com)**
ariadne@mirumee.com
