Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: display progress bar when downloading multi-page responses #72

Open
hydrosquall opened this issue Apr 21, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@hydrosquall
Copy link

hydrosquall commented Apr 21, 2022

Motivation

For a long running command (longer than 1 minute) for a big table (like pull requests or commits), it can be tricky to know if the script is still running, or if a rate limit/error was encountered

We know how many pages there are, so it may be possible to indicate how many remain.

url = "https://api.github.com/repos/{}/pulls?state=all&filter=all".format(repo)

Resources

@simonw simonw added the enhancement New feature or request label Apr 21, 2022
@simonw
Copy link
Collaborator

simonw commented Apr 21, 2022

That's interesting - yeah it looks like the number of pages can be derived from the Link header, which is enough information to show a progress bar, probably using Click just to avoid adding another dependency.

https://docs.github.com/en/rest/guides/traversing-with-pagination

@hydrosquall hydrosquall changed the title feature: display progress bar when downloading responses feature: display progress bar when downloading multi-page responses Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants