Skip to content

Module for consuming Github GraphQL API in Python.

Notifications You must be signed in to change notification settings

fer/github-graphql-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

github-graphql-client

Module for consuming Github GraphQL API in Python.

Install

pip install git+https://github.com/fer/github-graphql-client.git

Usage

Get your Personal access tokens from GitHub.

from github_graphql_client import GitHubGraphQLClient

ACCESS_TOKEN = '<your_access_token>' 

gh_gql = GitHubGraphQLClient(ACCESS_TOKEN, './logs/GitHubGraphQLClient.log')

Query without pagination:

rate_limit = gh_gql.query(
    'graphql/GitHub/get-ratelimit.graphql'
)['data']['rateLimit']

Query with pagination:

import pandas as pd

TERM = 'poc-'

print(f"Searching for '{TERM}' repos...")    

repos = gh_gql.query_pagination(
    'graphql/GitHub/search-repos-query.graphql', 
    {
        'queryString': f'org:backbase-rnd {TERM}'
    }
)

df = pd.DataFrame(repos)

About

Module for consuming Github GraphQL API in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages