gituser/docker_multiarch/: gql-3.5.2 metadata and description

Homepage Simple index

GraphQL client for Python

author Syrus Akbary
author_email me@syrusakbary.com
classifiers
  • Development Status :: 5 - Production/Stable
  • Intended Audience :: Developers
  • Topic :: Software Development :: Libraries
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3 :: Only
  • Programming Language :: Python :: 3.7
  • Programming Language :: Python :: 3.8
  • Programming Language :: Python :: 3.9
  • Programming Language :: Python :: 3.10
  • Programming Language :: Python :: 3.11
  • Programming Language :: Python :: 3.12
  • Programming Language :: Python :: Implementation :: PyPy
description_content_type text/markdown
keywords api graphql protocol rest relay gql client
license MIT
provides_extras websockets
requires_dist
  • graphql-core<3.2.5,>=3.2
  • yarl<2.0,>=1.6
  • backoff<3.0,>=1.11.1
  • anyio<5,>=3.0
  • aiohttp<4,>=3.8.0; python_version <= "3.11" and extra == "aiohttp"
  • aiohttp<4,>=3.9.0b0; python_version > "3.11" and extra == "aiohttp"
  • requests<3,>=2.26; extra == "all"
  • requests-toolbelt<2,>=1.0.0; extra == "all"
  • httpx<1,>=0.23.1; extra == "all"
  • websockets<12,>=10; extra == "all"
  • botocore<2,>=1.21; extra == "all"
  • aiohttp<4,>=3.8.0; python_version <= "3.11" and extra == "all"
  • aiohttp<4,>=3.9.0b0; python_version > "3.11" and extra == "all"
  • botocore<2,>=1.21; extra == "botocore"
  • requests<3,>=2.26; extra == "dev"
  • requests-toolbelt<2,>=1.0.0; extra == "dev"
  • httpx<1,>=0.23.1; extra == "dev"
  • websockets<12,>=10; extra == "dev"
  • botocore<2,>=1.21; extra == "dev"
  • black==22.3.0; extra == "dev"
  • check-manifest<1,>=0.42; extra == "dev"
  • flake8==3.8.1; extra == "dev"
  • isort==4.3.21; extra == "dev"
  • mypy==0.910; extra == "dev"
  • sphinx<6,>=5.3.0; extra == "dev"
  • sphinx-rtd-theme<1,>=0.4; extra == "dev"
  • sphinx-argparse==0.2.5; extra == "dev"
  • types-aiofiles; extra == "dev"
  • types-mock; extra == "dev"
  • types-requests; extra == "dev"
  • parse==1.15.0; extra == "dev"
  • pytest==7.4.2; extra == "dev"
  • pytest-asyncio==0.21.1; extra == "dev"
  • pytest-console-scripts==1.3.1; extra == "dev"
  • pytest-cov==3.0.0; extra == "dev"
  • mock==4.0.2; extra == "dev"
  • aiofiles; extra == "dev"
  • aiohttp<4,>=3.8.0; python_version <= "3.11" and extra == "dev"
  • vcrpy==4.4.0; python_version <= "3.8" and extra == "dev"
  • aiohttp<4,>=3.9.0b0; python_version > "3.11" and extra == "dev"
  • vcrpy==7.0.0; python_version > "3.8" and extra == "dev"
  • httpx<1,>=0.23.1; extra == "httpx"
  • requests<3,>=2.26; extra == "requests"
  • requests-toolbelt<2,>=1.0.0; extra == "requests"
  • requests<3,>=2.26; extra == "test"
  • requests-toolbelt<2,>=1.0.0; extra == "test"
  • httpx<1,>=0.23.1; extra == "test"
  • websockets<12,>=10; extra == "test"
  • botocore<2,>=1.21; extra == "test"
  • parse==1.15.0; extra == "test"
  • pytest==7.4.2; extra == "test"
  • pytest-asyncio==0.21.1; extra == "test"
  • pytest-console-scripts==1.3.1; extra == "test"
  • pytest-cov==3.0.0; extra == "test"
  • mock==4.0.2; extra == "test"
  • aiofiles; extra == "test"
  • aiohttp<4,>=3.8.0; python_version <= "3.11" and extra == "test"
  • vcrpy==4.4.0; python_version <= "3.8" and extra == "test"
  • aiohttp<4,>=3.9.0b0; python_version > "3.11" and extra == "test"
  • vcrpy==7.0.0; python_version > "3.8" and extra == "test"
  • parse==1.15.0; extra == "test-no-transport"
  • pytest==7.4.2; extra == "test-no-transport"
  • pytest-asyncio==0.21.1; extra == "test-no-transport"
  • pytest-console-scripts==1.3.1; extra == "test-no-transport"
  • pytest-cov==3.0.0; extra == "test-no-transport"
  • mock==4.0.2; extra == "test-no-transport"
  • aiofiles; extra == "test-no-transport"
  • vcrpy==4.4.0; python_version <= "3.8" and extra == "test_no_transport"
  • vcrpy==7.0.0; python_version > "3.8" and extra == "test_no_transport"
  • websockets<12,>=10; extra == "websockets"
File Tox results History
gql-3.5.2-py2.py3-none-any.whl
Size
73 KB
Type
Python Wheel
Python
2.7

GQL

This is a GraphQL client for Python 3.7+. Plays nicely with graphene, graphql-core, graphql-js and any other GraphQL implementation compatible with the spec.

GQL architecture is inspired by React-Relay and Apollo-Client.

GitHub-Actions pyversion pypi Anaconda-Server Badge codecov

Documentation

The complete documentation for GQL can be found at gql.readthedocs.io.

Features

Installation

You can install GQL with all the optional dependencies using pip:

# Quotes may be required on certain shells such as zsh.
pip install "gql[all]"

NOTE: See also the documentation to install GQL with less extra dependencies depending on the transports you would like to use or for alternative installation methods.

Usage

Basic usage

from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport

# Select your transport with a defined url endpoint
transport = AIOHTTPTransport(url="https://countries.trevorblades.com/")

# Create a GraphQL client using the defined transport
client = Client(transport=transport, fetch_schema_from_transport=True)

# Provide a GraphQL query
query = gql(
    """
    query getContinents {
      continents {
        code
        name
      }
    }
"""
)

# Execute the query on the transport
result = client.execute(query)
print(result)

Executing the above code should output the following result:

$ python basic_example.py
{'continents': [{'code': 'AF', 'name': 'Africa'}, {'code': 'AN', 'name': 'Antarctica'}, {'code': 'AS', 'name': 'Asia'}, {'code': 'EU', 'name': 'Europe'}, {'code': 'NA', 'name': 'North America'}, {'code': 'OC', 'name': 'Oceania'}, {'code': 'SA', 'name': 'South America'}]}

WARNING: Please note that this basic example won't work if you have an asyncio event loop running. In some python environments (as with Jupyter which uses IPython) an asyncio event loop is created for you. In that case you should use instead the async usage example.

Contributing

See CONTRIBUTING.md

License

MIT License