Skip to content

The modern, all-batteries-included GitHub SDK for Python, including rest api, graphql, webhooks, like octokit!

License

Notifications You must be signed in to change notification settings

yanyongyu/githubkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ddcc0a4 Β· Mar 30, 2025
Dec 25, 2024
Jan 24, 2025
Mar 30, 2025
Mar 30, 2025
Mar 22, 2025
Mar 30, 2025
Nov 25, 2024
Mar 30, 2025
Jul 9, 2022
Jan 8, 2024
Oct 8, 2024
Mar 22, 2025
Mar 20, 2024
Oct 5, 2024
Jul 21, 2022
Oct 8, 2024
Oct 5, 2024
Oct 4, 2024
Mar 22, 2025
Mar 22, 2025

Repository files navigation

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