PubMed XML Parser
Installation
python3 -m pip install pubmed_xml
Usage
CommandLine
pubmed_xml --help
pubmed_xml 30003000
pubmed_xml 30003000,30003001,30003002
pubmed_xml 30003000 30003001 30003002
pubmed_xml tests/pubmed22n1543.xml.gz -o out.jl
pubmed_xml 30003000,30003001,30003002 -o out.jl
Python
from pubmed_xml import Pubmed_XML_Parser
pubmed = Pubmed_XML_Parser()
for article in pubmed.parse('30003000,30003001,30003002'):
print(article)
print(article.data)
print(article.to_json(indent=2))
print(article.pmid, article.title, article.abstract)
print(article['pmid'], article['title'], article['abstract'])