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

[!TIP] Open in Codespaces (Dev Container):

Open in GitHub Codespaces

See the development in the contributing guide.

Contributors

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

contributors

Project details


Release history Release notifications | RSS feed

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.13.1.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

githubkit-0.13.1-py3-none-any.whl (5.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: githubkit-0.13.1.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.8

File hashes

Hashes for githubkit-0.13.1.tar.gz
Algorithm Hash digest
SHA256 b033f2742e37e461849f8de1475d0e81931ea798c73d12211007fd148c621123
MD5 ff5e8600bb7b59cd8268dfc8d81ab772
BLAKE2b-256 650a792e08689ccf16425e9194a9827c3e19fc2af35d957e75bb5190fff8d8f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: githubkit-0.13.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.8

File hashes

Hashes for githubkit-0.13.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c73130e666486ee4af66cf143267bf0b8e446577de3c28090d45b83e8f0a3d02
MD5 4f7ef0c2511db95645cee62f4cbeb609
BLAKE2b-256 165bbfe5f12b1cebb2840e8156de4cacc6281820a11ab6f13efd26e1e8bd6512

See more details on using hashes here.

Supported by

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