gijswobben / pymed

PyMed is a Python library that provides access to PubMed.
MIT License
191 stars 111 forks source link

Could you please add support for API key? #29

Open rgranit opened 4 years ago

rgranit commented 4 years ago

Is your feature request related to a problem? Please describe. Currently one cannot enter the PubMed API key, so one cannot increase the rate limit to 10calls/sec

Describe the solution you'd like It would be great to add another param to the PubMed object.

Describe alternatives you've considered Writing my own code to handle the API :)

Additional context See here for info about the API key

THANKS!

jc639 commented 4 years ago

For anyone wondering you can monkey patch this.

from pymed import PubMed
pubmed = PubMed(tool='my_tool', email='myemail@email.com')

my_api_key = 'thisismyapikey'
pubmed.parameters.update({'api_key': my_api_key})

and you probably want to up the rate limit,: pubmed._rateLimit = 10