githubkit

The modern, all-batteries-included GitHub SDK for Python: fully typed, sync and async, with REST, GraphQL, and webhook support.

SDK
PyPI
v0.16.1
341stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
83/100Excellent
Development Activity92
Maintenance100
Community56
Maturity56
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
82/100Excellent
Architecture88
Code Quality86
Innovation85
Learning Curve70

githubkit is a comprehensive GitHub SDK for Python, inspired by JavaScript’s octokit, that gives you fully typed access to the entire GitHub platform. It exposes the REST API, GraphQL, and webhook handling behind a single client that works in both synchronous and asynchronous code, with Pydantic models for every request and response so your editor and type checker understand each field.

Because its REST layer is generated from GitHub’s official OpenAPI descriptions, githubkit stays current with the API and supports REST versioning, multiple authentication strategies, OAuth flows, and pagination out of the box. It is designed for anything from a quick script to a production GitHub App that needs reliable, type-safe access to the API.

What You Get

  • A single typed client for GitHub REST, GraphQL, and webhook events
  • Both synchronous and asynchronous calling styles from one API
  • Pydantic models for every request and response, generated from GitHub’s OpenAPI spec
  • Multiple authentication methods including token, GitHub App, and full OAuth flows
  • REST API versioning plus built-in pagination helpers

Common Use Cases

  • Building a GitHub App or bot that reacts to webhook events
  • Automating repository, issue, or CI operations from Python scripts
  • Querying GitHub data efficiently via REST or GraphQL with full typing

Under The Hood

Architecture githubkit centers on a GitHub client that composes REST, GraphQL, and webhook subsystems over a shared httpx-based transport. The bulk of the REST surface lives in generated versions/ modules produced by the repo’s codegen/ pipeline from GitHub’s OpenAPI descriptions, while auth strategies (token, App, OAuth) are pluggable objects injected into the client and pagination is handled by dedicated helpers.

Tech Stack Python 3.10+ built on httpx for sync and async transport and Pydantic for typed models, with uv for dependency management. Tooling is strict and modern: black formatting, ruff linting, pyright type checking, and pre-commit CI. The generated code accounts for the repository’s very large Python file count.

Code Quality The project enforces type correctness with pyright and organizes tests under tests/ into REST, GraphQL, webhook, auth, and versioning suites. Codegen keeps the enormous API surface consistent and reduces hand-written error, and codecov tracks coverage.

API Design The ergonomics are a highlight: one client exposes github.rest.*, GraphQL, and webhook helpers, and switching between sync and async is a matter of which method form you call. Rich typing means editors autocomplete endpoint parameters and response fields, keeping boilerplate low despite GitHub’s breadth.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search