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

add progress bar to download_get #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dluks
Copy link
Contributor

@dluks dluks commented Jan 19, 2024

I added a simple tqdm progress bar to the gbif_GET_write function as a quality-of-life improvement.

Description

I often need to download large files from GBIF and have wished I could see the progress. This addresses that. I don't know what the sentiment is toward requirements on this project, so I hope the inclusion of tqdm isn't against principle.

Example

import pygbif.occurences as occ

occ.download_get("0000066-140928181241064")
INFO:Download file size: 143097 bytes
100%|██████████| 143k/143k [00:00<00:00, 1.14MB/s]
INFO:On disk at [./0000066-140928181241064.zip](https://file+.vscode-resource.vscode-cdn.net/Users/dluks/local_projects/pygbif/0000066-140928181241064.zip)
{'path': './0000066-140928181241064.zip',
 'size': 143097,
 'key': '0000066-140928181241064'}

All tests continue to pass, but, given the minimal testing of download_get at present, I didn't add anything. I'm not exactly sure how I'd test this anyway 🤔 .

@dluks
Copy link
Contributor Author

dluks commented Jan 21, 2024

When adding tqdm to setup.py, I noticed that black formatting hadn't been applied. Commit 48d45a6 includes that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant