Last active
October 24, 2016 21:55
-
-
Save Jonovono/a0f4c34d3e40a317898ec930936a0180 to your computer and use it in GitHub Desktop.
Medline API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you need to install Biopython: | |
# pip install biopython | |
# Full discussion: | |
# https://marcobonzanini.wordpress.com/2015/01/12/searching-pubmed-with-python/ | |
from Bio import Entrez, Medline | |
IDS = ['20808220', '20396467', '17903820', '17903981'] | |
if __name__ == '__main__': | |
Entrez.email = '[email protected]' | |
ids_joined = ','.join(IDS) | |
handle = Entrez.efetch(db='pubmed', | |
retmode='text', | |
rettype='medline', | |
id=ids_joined) | |
records = Medline.parse(handle) | |
for record in records: | |
for key, value in record.iteritems(): | |
print "%s - %s" % (key, value) | |
print '***********************' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment