Skip to main content

Pubmed XML Parser

Project description

PubMed XML Parser

Installation

python3 -m pip install pubmed_xml

Usage

CommandLine

pubmed_xml --help

# parse single
pubmed_xml 30003000

# parse batch
pubmed_xml 30003000,30003001,30003002

# parse multiple
pubmed_xml 30003000 30003001 30003002

# parse from xml file
pubmed_xml tests/pubmed22n1543.xml.gz -o out.jl

# save file
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)        # Article<30003002>
    print(article.data)   # dict object
    print(article.to_json(indent=2))   # json string
    print(article.pmid, article.title, article.abstract) # by attribute
    print(article['pmid'], article['title'], article['abstract']) # by key

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pubmed_xml-1.0.1.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

pubmed_xml-1.0.1-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page