GRatekeeper is a lightweight GitHub API helper with proactive rate-limit throttling
Project description
GRatekeeper
GRatekeeper (“GitHub Ratekeeper”) is a lightweight companion for monitoring and controlling GitHub API usage. It gives you:
- A lean, configurable dashboard (
gk-dash/gratekeeper-dashboard) that shows every quota bucket, Actions activity, and billing minutes, with quick toggles and themes. - A drop-in
requests.Sessionwrapper (RateLimitedGitHubClient) that enforces a soft floor before you hit zero, plus optional killswitches for runaway jobs.
Why it’s different from simple retries/backoff:
- Adaptive throttling before zero: While other libraries offer automatic retries and backoff, Gratekeeper slows down your requests before you hit the limit, making it safe to aggressively script your application's API calls without worrying about crossing over into the dreaded secondary rate limit, possibly encurring penalties or prolonged cooldown periods.
- Multi-process friendly: The dashboard/socket lets multiple scripts share live bucket state so one noisy job doesn’t blind the others.
- Last-resort brakes: A killswitch can stop all new requests during incidents, avoiding secondary rate limits.
Quick start
Install (Python 3.10+):
pip install gratekeeper
Use the client:
from gratekeeper import RateLimitedGitHubClient
client = RateLimitedGitHubClient() # picks up $GITHUB_TOKEN
me = client.get_json("/user")
print(me["login"])
Run the dashboard:
gk-dash --refresh 10 --fetch 30 --actions my-org/my-repo
# prefer a simpler table? add --ui table
Common tasks:
- Customize HTTP: pass
token,base_url,user_agent, orbucket="search"to isolate quotas. - Disable throttling temporarily:
enable_ratekeeping=Falseon the client. - Themes/presets/bucket toggles/Actions on/off are built into the Textual UI; see the dashboard guide below.
Security and compatibility
- The socket bridge is local-only but unauthenticated; change the path or disable with
--socket none/GRATEKEEPER_SOCKET=noneon shared hosts. On Windows, the bridge is disabled automatically. - Works with REST and GraphQL; buckets stay separate unless you intentionally merge them via
bucket=....
Where to go next
- Rate-limit math, soft floor, killswitch details: EXPLAINER.md
- Advanced client features (polling, listeners, socket bridge, logging, dev/demos): ADVANCED_USAGE.md
- Dashboard controls (themes, Active-only/manual presets, digit toggles, Hide Actions): docs/dashboard-bucket-visibility.md
- Local dev, tests, demos: CONTRIBUTING.md and
scripts/run_demo_scenarios.py
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gratekeeper-0.7.0.tar.gz.
File metadata
- Download URL: gratekeeper-0.7.0.tar.gz
- Upload date:
- Size: 42.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee5e5e388b0e7b2ef6e7918708c0064ed7c485bbcdb49808bf6832ccf46b7d2a
|
|
| MD5 |
6da779da0bd885545485a7ef033903cb
|
|
| BLAKE2b-256 |
e245afa85bb9b8bd456e87d86b68690008e7300c0088c0a0ba2ad72941aba1e2
|
Provenance
The following attestation bundles were made for gratekeeper-0.7.0.tar.gz:
Publisher:
publish.yml on hesreallyhim/GRatekeeper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gratekeeper-0.7.0.tar.gz -
Subject digest:
ee5e5e388b0e7b2ef6e7918708c0064ed7c485bbcdb49808bf6832ccf46b7d2a - Sigstore transparency entry: 709692366
- Sigstore integration time:
-
Permalink:
hesreallyhim/GRatekeeper@62db89aec04dff5c3c6e18909f28f2a4b9b8cf2f -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/hesreallyhim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@62db89aec04dff5c3c6e18909f28f2a4b9b8cf2f -
Trigger Event:
release
-
Statement type:
File details
Details for the file gratekeeper-0.7.0-py3-none-any.whl.
File metadata
- Download URL: gratekeeper-0.7.0-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10a201efcb32f900104cbb81990f41c1a1c580cdc2b67dc01685364dbab6c89f
|
|
| MD5 |
e009ae27e6b9fa325d8c592369c219fd
|
|
| BLAKE2b-256 |
0c202408b36de11c4db7a4c14f4ab4347bbaba91a1189b5bebef3db1433301e2
|
Provenance
The following attestation bundles were made for gratekeeper-0.7.0-py3-none-any.whl:
Publisher:
publish.yml on hesreallyhim/GRatekeeper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gratekeeper-0.7.0-py3-none-any.whl -
Subject digest:
10a201efcb32f900104cbb81990f41c1a1c580cdc2b67dc01685364dbab6c89f - Sigstore transparency entry: 709692367
- Sigstore integration time:
-
Permalink:
hesreallyhim/GRatekeeper@62db89aec04dff5c3c6e18909f28f2a4b9b8cf2f -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/hesreallyhim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@62db89aec04dff5c3c6e18909f28f2a4b9b8cf2f -
Trigger Event:
release
-
Statement type: