Skip to main content

GraphQL Engine for Python

Project description

Tartiflette

Quality Gate Status Total alerts Language grade: Python

Tartiflette is a GraphQL Server implementation built with Python 3.6+.

Summary

Motivation

Read this blogpost about our motivations TL; DR We reached the limits of Graphene, we wanted to build something which met certain requirements:

  • Offers a better developer experience that respects the Python mindset
  • Uses SDL (Schema Definition Language)
  • Uses asyncio as the sole execution engine
  • Be 100% open source

Status

The first milestone is behind us, we are now on the road to the milestone 2.

DNA

Discover Tartiflette with our fabulous tutorial on https://tartiflette.io/docs/tutorial/getting-started

Usage

import asyncio

from tartiflette import Resolver, create_engine

@Resolver("Query.hello")
async def resolver_hello(parent, args, ctx, info):
    return "hello " + args["name"]


async def run():
    engine = await create_engine(
        """
        type Query {
            hello(name: String): String
        }
        """
    )

    result = await engine.execute(
        query='query { hello(name: "Chuck") }'
    )

    print(result)
    # {'data': {'hello': 'hello Chuck'}}

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(run())

More details on the API Documentation

Installation

Tartiflette is available on pypi.org.

While the project depends on libgraphqlparser, wheels are provided since version 1.4.0, ensuring that no system dependency is required.

To install the library:

pip install tartiflette

Building from source

If you use a platform incompatible with the provided wheels, you'll need to install cmake to build libgraphqlparser in order to install the library.

macOS

brew install cmake

Debian/Ubuntu

apt-get install cmake

HTTP server implementations

tartiflette library itself is transport agnostic, but to simplify integration with existing HTTP servers, two different libraries are available:

Roadmaps

How to contribute to the documentation?

As you may know, the documentation is hosted on https://tartiflette.io. This fabulous website is built thanks to another amazing tool, docusaurus.

The content of the documentation is hosted in this repository, to be as close as possible to the code. You will find everything you need/want in the folder /docs.

How to run the website locally?

We built a docker image for the documentation (tartiflette/tartiflette.io on docker hub), which allow us to provide you an easy way to launch the documentation locally, without installing a specific version of node.

prerequisite:

  • Docker
  • Docker Compose
  • Make
make run-docs

Every change you will make in the /docs folder will be automatically hot reloaded. :tada:

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.

Files for tartiflette, version 1.4.1
Filename, size File type Python version Upload date Hashes
Filename, size tartiflette-1.4.1.tar.gz (189.6 kB) File type Source Python version None Upload date Hashes View
Filename, size tartiflette-1.4.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (481.9 kB) File type Wheel Python version pp37 Upload date Hashes View
Filename, size tartiflette-1.4.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (341.3 kB) File type Wheel Python version pp37 Upload date Hashes View
Filename, size tartiflette-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (481.9 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size tartiflette-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl (341.3 kB) File type Wheel Python version cp310 Upload date Hashes View
Filename, size tartiflette-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (481.9 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size tartiflette-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl (341.3 kB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size tartiflette-1.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (481.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size tartiflette-1.4.1-cp38-cp38-macosx_10_9_x86_64.whl (341.3 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size tartiflette-1.4.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (481.9 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size tartiflette-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl (341.3 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size tartiflette-1.4.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (481.9 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size tartiflette-1.4.1-cp36-cp36m-macosx_10_9_x86_64.whl (341.3 kB) File type Wheel Python version cp36 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page