maximilien / ghtrack

A python tool to keep track of GitHub users stats
Apache License 2.0
3 stars 3 forks source link

Add a way to rate limit since some queries take time and will result in GitHub rate limit errors #7

Closed maximilien closed 4 years ago

maximilien commented 4 years ago

Feature request

Provide a means to slow down API requests to avoid rate limit errors

Use case

Some ght queries take a long time and results in 100s of API requests which will end up in rate limit errors. Provide a way to slow down (sleep) after some number of API requests.

UI Example

./ght stats july knative --commits --issues --reviews \
                                       --rate-limit -rt-max 100 --rt-sleep 30m \
                                       --summarize --users=maximilien,octocat \
                                       --repos=client,client-contrib \
                                       --show-all-stats -o csv -f out.csv

By specifying options: --rate-limit -rt-max 100 --rt-sleep 30m then the request to ght will attempt to do some rate limiting by sleeping for 30 minutes after every 100 API requests.