Skip to content

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.

@jhnwllr
Copy link
Contributor

jhnwllr commented Dec 3, 2024

@dluks thanks for adding this. I am a little reluctant to add a dependency for just this functionality. Would it be possible to make it more opt in with perhaps an extra arg for download_get?

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.

2 participants