Skip to main content

Thin wrapper for interacting with the Github GraphQL API

Project description

ghgql

Thin wrapper for interacting with the Github GraphQL API.

Status

Documentation Status CodeQL ci-cd codecov release

Documentation

Please find the documentation and usage examples here: https://ghgql.readthedocs.io/en/latest/

Installation

$ pip install ghgql

Usage

For a more in-depth example, take a look at the example in the documentation. Here's a basic example.

import os
import ghgql

query = """
query ($searchQuery: String!) {
  search(query: $searchQuery, type: ISSUE, first: 1) {
    edges {
      node {
        ... on Issue {
          id
          number
          title
          url
        }
      }
    }
  }
}
"""

with ghgql.GithubGraphQL(token=os.getenv("GITHUB_TOKEN")) as ghapi:
    result = ghapi.query(query=query, variables={"searchQuery": "llvm/llvm-project"})
    print(result.get("search.edges"))

Should output something like this:

[{'node': {'id': 'I_kwDOHicqdc5RG-tC',
   'number': 16,
   'title': 'llvm/llvm-project',
   'url': 'https://github.com/KhushP786/open-sauced-goals/issues/16'}}]

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

Commit message conventions and semantic versioniong (semver)

We use semantic versioning and these commit message conventions can be used to automatically bump the version number and generate the changelog.

License

ghgql was created by Konrad Kleine. It is licensed under the terms of the MIT license.

Credits

ghgql was created with cookiecutter and the py-pkgs-cookiecutter template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghgql-0.0.11.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ghgql-0.0.11-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file ghgql-0.0.11.tar.gz.

File metadata

  • Download URL: ghgql-0.0.11.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for ghgql-0.0.11.tar.gz
Algorithm Hash digest
SHA256 18f52862d0e4f3f8a56394d4cf31721fe14264b8a9e0f29f2952e1076e9e2ec4
MD5 9fd068cc8c5dfb447549f57fc8fffc88
BLAKE2b-256 8440d382db3380605a5979d9a8aff6efe835023e1844ccaf686f111869b4e6a2

See more details on using hashes here.

File details

Details for the file ghgql-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: ghgql-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for ghgql-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 7d25eba68ea3771bf9968272faf503750430070206cda9b8bd3a08819a2d69e6
MD5 d9cb24d154a2b1e7cb97b01c5744a804
BLAKE2b-256 7b32a78b62ef97e145303f28a71fb9421a440f69943689fbe9e47789eb05b0d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page