https://github.com/suqingdong/pmc_xml
XML parser for PubMed Central (PMC) Database
https://github.com/suqingdong/pmc_xml
pmc
Last synced: 5 months ago
JSON representation
XML parser for PubMed Central (PMC) Database
- Host: GitHub
- URL: https://github.com/suqingdong/pmc_xml
- Owner: suqingdong
- Created: 2025-01-23T09:51:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-12-16T08:33:26.000Z (6 months ago)
- Last Synced: 2025-12-19T19:08:12.640Z (6 months ago)
- Topics: pmc
- Language: Python
- Homepage: https://suqingdong.github.io/pmc_xml/
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# XML parser for PubMed Central (PMC) Database
## Installation
```bash
python3 -m pip install pmc_xml
```
## Usage
### CommandLine
```bash
pmc_xml --help
# parse single
pmc_xml PMC6039336
# parse batch
pmc_xml PMC6039336,PMC6031859,PMC6031856
# parse multiple
pmc_xml PMC6039336 PMC6031859 PMC6031856
# save file
pmc_xml PMC6039336,PMC6031859,PMC6031856 -o out.jl
```
### Python
```python
from pmc_xml import PMC_XML_Parser
pmc = PMC_XML_Parser()
for article in pmc.parse('PMC6039336,PMC6031859,PMC6031856'):
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
```