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.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

pubmed_xml-1.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file pubmed_xml-1.0.0.tar.gz.

File metadata

  • Download URL: pubmed_xml-1.0.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.3

File hashes

Hashes for pubmed_xml-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1fb6d67c0e2437790fbd5deeb192e0d0042ab8ef20983d4728158b2db922c3f5
MD5 e4405d5d7f0100eafef50fde97718746
BLAKE2b-256 efe3aab167e6b7b273210d947a40b9683ad5c84032cb73844cba9d07c9ed7b62

See more details on using hashes here.

File details

Details for the file pubmed_xml-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pubmed_xml-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.8.3

File hashes

Hashes for pubmed_xml-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c84b3206746024b844a157eb7b9c78e4bc27cd253fe3b01bc71c69bab7fc2c5
MD5 802da5ad64823990aad99aad4bf80c5e
BLAKE2b-256 532d51056474edab779bd296b0f1d5b6c264334a3b39309103c2f31473c0b7ea

See more details on using hashes here.

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