Skip to main content

GraphQL Client for Pythonistas

Project description

🌐🐍 gql.py
-------

_GraphQL Client for Pythonistas_

gql.py is a Pythonic interface around graphQL APIs.

You've got a graphQL API, and you want to talk to it, right?

GraphQL's use of HTTP is questionable at best, for those of us who love HTTP standards. But you can't deny graphQL's usefulness. The goal of this library is to remove the fuss of HTTP so you can deal with graphQL directly. Just how graphQL's developers intended.

[![PyPi][pypi-image]][pypi-link]
[![CircleCI][circle-image]][circle-link]
[![Coverage Status][codecov-image]][codecov-link]
[![Landscape Status][landscape-image]][landscape-link]

```python

from gql_py import Gql

gql = Gql(api='https://graphql.org/swapi-graphql')

query = '''
query ($bookId: ID!) {
book(id: $bookId) {
id
title
author
}
}
'''
variables = {
'book_id': '654'
}

response = qgl.send(query=query, variables=variables)

response.ok
>>> True

response.errors
>>> None

response.data
>>> {'book': {'id': '654', 'title': 'Ursula K. Le Guin', 'title': 'A Wizard of Earthsea'}}

```

📖 Features
--------

- No need to handle the HTTP layer. (You can still set HTTP headers, though!)
- Responses come back as named tuples - even errors!
- Python 3.6+

✨ Future goals
---------------

- Draw graphQL queries & mutations with Python code.
- Hydrate API responses into Python objects.

🏗 Status
----------

gql.py is currently under development.


🎥 Credits
---------

This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter).

We use [Python Requests](http://docs.python-requests.org/en/master/) for talking HTTP.


[pypi-image]: https://img.shields.io/pypi/v/gql_py.svg
[pypi-link]: https://pypi.python.org/pypi/gql_py
[pypi-dl-image]: https://img.shields.io/pypi/dm/gql_py.png
[circle-image]: https://circleci.com/gh/phalt/gql_py/tree/master.svg?style=svg
[circle-link]: https://circleci.com/gh/phalt/gql_py/tree/master
[codecov-image]: https://codecov.io/gh/phalt/gql_py/branch/master/graph/badge.svg?token=T9mYPv0Ep2
[codecov-link]: http://codecov.io/github/phalt/gql_py?branch=master
[landscape-image]: https://landscape.io/github/phalt/gql_py/master/landscape.svg?style=flat&badge_auth_token=0cce4803ec014cf4ad889498bba7e7e7
[landscape-link]: https://landscape.io/github/phalt/gql_py/master


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gql_py-0.3.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

gql_py-0.3.0-py2.py3-none-any.whl (5.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file gql_py-0.3.0.tar.gz.

File metadata

  • Download URL: gql_py-0.3.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

File hashes

Hashes for gql_py-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e105377a603416452049c8206d6a8eedc30fdaeaac67b3df98be322ec6efa147
MD5 7ae88c4b72b8a90c509f77efb8b482a7
BLAKE2b-256 1ecedff8e6def657457eb1c145026099ac722243b5656c155985edc230f623d5

See more details on using hashes here.

File details

Details for the file gql_py-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: gql_py-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5

File hashes

Hashes for gql_py-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f9200ff04afb88ae74cbdabaa1418af69f2aaf524ecd136ae848e2a0cb40315d
MD5 f117556044de2cacaee5b33700239604
BLAKE2b-256 007e1d319cde1afd7b9b5c7ede044ffe9d43a82f8b67566c800ea10c22e748f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page