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

[ENH] Accept API keys #60

Closed
Maarten-vd-Sande opened this issue Sep 8, 2020 · 1 comment
Closed

[ENH] Accept API keys #60

Maarten-vd-Sande opened this issue Sep 8, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Maarten-vd-Sande
Copy link
Contributor

Maarten-vd-Sande commented Sep 8, 2020

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 api_key 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.

@Maarten-vd-Sande Maarten-vd-Sande added the enhancement New feature or request label Sep 8, 2020
@Maarten-vd-Sande Maarten-vd-Sande mentioned this issue Sep 8, 2020
@saketkc
Copy link
Owner

saketkc commented Sep 11, 2020

Closed via #61

@saketkc saketkc closed this as completed Sep 11, 2020
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