Skip to content
A lightweight Python GraphQL client.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs 0.1.2 docs Apr 1, 2019
tests Execution unit tests Apr 1, 2019
.gitignore Start tests Mar 26, 2019
.travis.yml Setup travis Mar 28, 2019
LICENSE Start project Mar 8, 2019
README.rst 0.1.2 docs Apr 1, 2019 0.1.2 docs Apr 1, 2019
requirements.txt Start tests Mar 26, 2019 Fix typo Apr 1, 2019


travis coveralls pypi


kirjava is a Python GraphQL client.


>>> import kirjava
>>> client = kirjava.Client("")
>>> client.execute("""{ me { name email }}""")
{'data': {'me': {'name': 'Jon Snow', 'email': ''}}}



kirjava can be installed using pip:

$ pip3 install kirjava

kirjava is written for Python 3, and does not support Python 2.

If you get permission errors, try using sudo:

$ sudo pip3 install kirjava


The repository for kirjava, containing the most recent iteration, can be found here. To clone the kirjava repository directly from there, use:

$ git clone git://


kirjava requires requests.


kirjava is a lightweight Python GraphQL client.

Making Queries with a Client

GraphQL services are interacted with using a Client object:

>>> import kirjava
>>> client = kirjava.Client("")

The client is associated with a particular URL upon creation.

Queries are then made using the execute method.

>>> client.execute("{ me { name email }}")
{'data': {'me': {'name': 'Jon Snow', 'email': ''}}}

If authentication tokens need to be added, they can be inserted into the headers:

>>> client.headers["Authorization"] = "dani123"

Variables can be passed along with the query:

>>> client.execute("{ me { name email }}", variables={"var1": 123})

You can see all previous queries made by a client:

>>> client.history
(({'string': { me { name email }}, 'variables': {'var1': 123}, {'data': {'me
': {'name': 'Jon Snow', 'email': ''}}}), ({'string': {
me { name email }}, 'variables': {}}, {'data': {'me': {'name': 'Jon Snow', '
email': ''}}}))

Making Queries without a Client

Alternatively, if creating a dedicated Client object is somehow beneath you, and you just want to fire off a quick request without any of that overhead, there is a module level execute function:

>>> kirjava.execute("", "{ me { name email }}", headers={"Authorization": "dani123"}, variables={"var1": 123})


Release 0.1.2

1 April 2019

  • Added module-level execute function.

Release 0.1.1

30 March 2019

  • Added tests.
  • Clients now store history of their queries.

Release 0.1.0

23 March 2019

  • Created basic Client.
You can’t perform that action at this time.