Skip to content

claudio-walser/srgssr-publication-data-api

 
 

Repository files navigation

PDP GraphQL client Python

API Client to access PDP's GraphQL API through python

USAGE

from sgqlc.types import Variable, non_null
from srgssr_publication_data_api import PublicationDataApi

# replace url, username, password with real values
client = PublicationDataApi(url, username, password)

op = client.query_op()

# to restrict fields to just title and cursor (for pagination):
selector = op.faro_items(first=5)
selector.edges().title()
selector.cursor()

# if you just want to see the schema, just remove the selector.

result = client.run_query(op)
print(result)
  1. for more details about building the queries, see also sgqlc usage docs (https://github.com/profusion/sgqlc#usage)

Development

For development check the documentation under docs/installation.rst.

Credits

This package was created with Cookiecutter and the elgertam/cookiecutter-pipenv project template, based on audreyr/cookiecutter-pypackage.

About

Python client to conveniently query PDP's GraphQL API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 88.6%
  • Python 9.5%
  • Makefile 1.2%
  • Other 0.7%