Skip to main content

GitHub SDK for Python

Project description

githubkit

license pypi python black pyright ruff pre-commit

✨ The modern, all-batteries-included GitHub SDK for Python ✨

✨ Support both sync and async calls, fully typed

✨ Always up to date, like octokit ✨

Documentation | Report Bug | GitHub Docs

githubkit aims to be an easy-to-use, fully typed, and always up-to-date GitHub SDK for Python. It is inspired by octokit.

githubkit provides several features including:

  • Support both sync and async calls
  • Multiple authentication ways and OAuth flow support
  • Calling REST API and GraphQL easily
  • REST API versioning, including GHEC
  • Built-in pagination support
  • Optional data validation with Pydantic, for both webhook events and REST API responses
  • Built-in http cache (powered by Hishel for HTTPX) and auto retry
  • Lazy loading of APIs and models
  • Fully typed APIs

Getting Started

For more, see the documentation.

Installation

Install githubkit with the package manager of your choice:

pip install githubkit
# or, use poetry
poetry add githubkit
# or, use pdm
pdm add githubkit
# or, use uv
uv add githubkit

Usage

Create a Personal Access Token (PAT) and use it to create a GitHub instance:

from githubkit import GitHub

github = GitHub("<your_token_here>")

Then, enjoy githubkit now!

from githubkit import Response
from githubkit.versions.latest.models import FullRepository

resp: Response[FullRepository] = github.rest.repos.get("owner", "repo")
repo: FullRepository = resp.parsed_data
print(repo.full_name)

Development

See the development in the contributing guide.

Contributors

Thanks to the following people who have contributed to this project:

contributors

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

githubkit-0.11.12.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

githubkit-0.11.12-py3-none-any.whl (5.1 MB view details)

Uploaded Python 3

File details

Details for the file githubkit-0.11.12.tar.gz.

File metadata

  • Download URL: githubkit-0.11.12.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for githubkit-0.11.12.tar.gz
Algorithm Hash digest
SHA256 f7f82998a04ac8d2606c26e87e3b2cd44adbf3838fcb99ddd654576503bba6ba
MD5 0cb9787eef92c90c3f26c08042df189f
BLAKE2b-256 2079947d782bb077e165060eec6fd7cfd7c826545bb7e20e6f4a8777c78c582a

See more details on using hashes here.

File details

Details for the file githubkit-0.11.12-py3-none-any.whl.

File metadata

  • Download URL: githubkit-0.11.12-py3-none-any.whl
  • Upload date:
  • Size: 5.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for githubkit-0.11.12-py3-none-any.whl
Algorithm Hash digest
SHA256 7bf4d47cff2db3baea05c701155fda9c28e690eeb8874090ff00f44442b06ead
MD5 d115f2c2696165953dc6f203b0487de0
BLAKE2b-256 c6221f651b0310d8e79483284c443f4ce8eb2b362aa958e813c1c2c5efcde3dc

See more details on using hashes here.

Supported by

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