Gidgethub is an asynchronous Python library for interacting with the GitHub API. It employs a sans-I/O approach, allowing users to integrate it with their preferred HTTP client library. The current version is 5.4.0 and it maintains an active release cadence, providing ongoing support and new features.
pip install gidgethubVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to make a simple API call to fetch user information using `gidgethub` with `aiohttp`. It requires a GitHub Personal Access Token set in the `GH_AUTH` environment variable for authentication.
Upgrade your Python environment to 3.8 or a later supported version.
Remove any manual inclusion of `machine-man-preview` headers when obtaining installation access tokens; `gidgethub` will handle this automatically.
Implement explicit error handling for `gidgethub.RateLimitExceeded` exceptions and incorporate your own rate-limiting or retry logic if necessary.
Configure your GitHub webhooks to use HMAC SHA256 for payload signatures. `gidgethub`'s webhook validation will automatically prefer this.
Design your webhook handlers to be independent of execution order. If sequential processing is critical, manage it within a single, composite callback function.