Skip to content
No description, website, or topics provided.
Python Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
graphql
pb
.gitignore
README.md
example.py
install_deps.sh
requirements.txt
update_deps.sh

README.md

dfuse GraphQL Python Example

This simple program demonstrates how easy it is to query our GraphQL API over gRPC in Python. It:

  • Request a token from our authentication API
  • Creates a gRPC connection with credentials
  • Instantiates a GraphQL client
  • Executes a simple GraphQL query
  • Prints the response

Requirements

You will need to have Python3 (>= 3.4+) as well as virtualenv and pip >= 15.0+.

We use a virtual environment for this example, all dependencies are listed in the requirements.txt at the root of this project.

Quickstart

First of all, visit https://app.dfuse.io to get a free API key for your project.

First, clone this repository to your work folder:

git clone https://github.com/dfuse-io/example-graphql-python.git
cd example-graphql-python

Setup the virtual environment and pull all dependencies:

./install_deps.sh

Once your environment is setup properly, simply run the example.py script:

python3 example.py YOUR_API_KEY_HERE
You can’t perform that action at this time.