Metadata-Version: 2.1
Name: qlient
Version: 1.0.0
Summary: A fast and modern graphql client designed with simplicity in mind.
Home-page: https://qlient-org.github.io/python-qlient/
License: MIT
Keywords: graphql,client,api,query,mutation
Author: Daniel Seifert
Author-email: info@danielseifert.ch
Maintainer: Daniel Seifert
Maintainer-email: info@danielseifert.ch
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Dist: qlient-core (>=1.0.1,<2.0.0)
Requires-Dist: requests (>=2.27.1,<3.0.0)
Requires-Dist: websocket-client (>=1.3.3,<2.0.0)
Project-URL: Documentation, https://qlient-org.github.io/python-qlient/
Project-URL: Repository, https://github.com/qlient-org/python-qlient
Description-Content-Type: text/markdown

# Qlient: Python GraphQL Client

[![DeepSource](https://deepsource.io/gh/qlient-org/python-qlient.svg/?label=active+issues&token=2ZJ0b1dinekjVtwgJHSy286C)](https://deepsource.io/gh/qlient-org/python-qlient/?ref=repository-badge)
[![DeepSource](https://deepsource.io/gh/qlient-org/python-qlient.svg/?label=resolved+issues&token=2ZJ0b1dinekjVtwgJHSy286C)](https://deepsource.io/gh/qlient-org/python-qlient/?ref=repository-badge)
[![pypi](https://img.shields.io/pypi/v/qlient.svg)](https://pypi.python.org/pypi/qlient)
[![versions](https://img.shields.io/pypi/pyversions/qlient.svg)](https://github.com/qlient-org/python-qlient)
[![license](https://img.shields.io/github/license/qlient-org/python-qlient.svg)](https://github.com/qlient-org/python-qlient/blob/master/LICENSE)
[![codestyle](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)

A fast and modern graphql client designed with simplicity in mind.

## Key Features

* Compatible with Python 3.7 and above
* Build on top of
  [qlient-core](https://github.com/qlient-org/python-qlient-core),
  [requests](https://github.com/psf/requests)
  and [websocket-client](https://github.com/websocket-client/websocket-client/)
* support for subscriptions

## Help

See [documentation](https://qlient-org.github.io/python-qlient/) for more details.

If you want more information about the internals,
I kindly refer you to the [qlient-core documentation](https://qlient-org.github.io/python-qlient-core/).

If you are looking for an asynchronous implementation,
I kindly refer you to the [qlient-aiohttp](https://github.com/qlient-org/python-qlient-aiohttp) sister project.

## Installation

```shell
pip install qlient
```

## Quick Start

````python
from qlient.http import HTTPClient, GraphQLResponse

client = HTTPClient("https://swapi-graphql.netlify.app/.netlify/functions/index")

res: GraphQLResponse = client.query.film(
    # swapi graphql input fields
    id="ZmlsbXM6MQ==",

    # qlient specific
    _fields=["id", "title", "episodeID"]
)

print(res.request.query)  # query film($id: ID) { film(id: $id) { id title episodeID } }
print(res.request.variables)  # {'id': 'ZmlsbXM6MQ=='}
print(res.data)  # {'film': {'id': 'ZmlsbXM6MQ==', 'title': 'A New Hope', 'episodeID': 4}}
````

