saketkc / pysradb

Package for fetching metadata and downloading data from SRA/ENA/GEO
https://saketkc.github.io/pysradb
BSD 3-Clause "New" or "Revised" License
307 stars 50 forks source link

[ENH] Accept API keys #60

Closed Maarten-vd-Sande closed 4 years ago

Maarten-vd-Sande commented 4 years ago

Is your feature request related to a problem? Please describe. The current API allows 3 requests per second, but with an api_key this is increased to 10 per second. https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/

This would mean a 3 times speedup for the lookup of samples when you add an api key to sraweb.

Describe the solution you'd like It looks like adding the api key to these lists of arguments would already work: https://github.com/saketkc/pysradb/blob/master/pysradb/sraweb.py#L74-L89

In that case all that needs to be changed is accepting an optional apikey argument to __init_\, and changing the sleeps. I would start a PR, but I am not entirely sure which sleep does what, and thus which one needs to be changed.

saketkc commented 4 years ago

Closed via #61