工作中,我经常需要编程访问PubMed的文献信息。为了方便从文章中解析出这些信息,我开发了一个Python包
(pubmed-mapper:https://github.com/soultoolman/pubmed-mapper/blob/master/README.md)。下面就以Associations of Coffee and Tea Consumption With Survival to Age 90 Years Among Older Women``(PubMed ID:32329900)为例来说明pubmed-mapper的用法。更多用法见https://github.com/soultoolman/pubmed-mapper/blob/master/README.md。
安装
pip install pubmed-mapper
使用
from pubmed_mapper import Article
article = Article.parse_pmid('32329900')
获取PubMed ID
print(article.pmid)
32329900
2. 获取其他ID,例如DOI、PubMed Central ID等
for id in article.ids:
print('ID类型:%s,ID值:%s' % (id.id_type, id.id_value))
ID类型:pubmed,ID值:32329900
ID类型:doi,ID值:10.1111/jgs.16467
3. 获取文章标题
print(article.title)
Associations of Coffee and Tea Consumption With Survival to Age 90 Years Among Older Women.
4. 获取文章摘要
print(article.abstract)
<p><strong>Background: </strong>Coffee and tea are two of the most widely consumed beverages worldwide and have been associated with reduced risk of mortality in some studies. However, it is unknown whether consumption of these beverages is associated with survival to an advanced age.</p>
...
5. 获取文章关键字
print(article.keywords)
['aging', 'coffee; diet; longevity', 'tea']
6. 获取文章MeSH
print(article.mesh_headings)
['Aged', 'Body Mass Index', 'Coffee', 'Diet', 'Female', 'Global Health', 'Humans', 'Life Style', 'Prospective Studies', 'Survival', 'Tea', "Women's Health"]
7. 获取文章作者信息
for author in article.authors:
print('姓名:%s,%s,单位:%s...' % (author.last_name, author.forename, author.affiliation[: 20]))
姓名:Shadyab,Aladdin H,单位:Department of Family...
姓名:Manson,JoAnn E,单位:Department of Epidem...
姓名:Luo,Juhua,单位:Department of Epidem...
姓名:Haring,Bernhard,单位:Department of Intern...
姓名:Saquib,Nazmus,单位:College of Medicine,...
姓名:Snetselaar,Linda G,单位:Department of Epidem...
姓名:Chen,Jiu-Chiuan,单位:Department of Preven...
姓名:Groessl,Erik J,单位:Department of Family...
姓名:Wassertheil-Smoller,Sylvia,单位:Department of Epidem...
姓名:Sun,Yangbo,单位:Department of Epidem...
姓名:Hale,Lauren,单位:Department of Family...
姓名:LeBoff,Meryl S,单位:Division of Endocrin...
姓名:LaCroix,Andrea Z,单位:Department of Family...
8. 获取文章期刊信息
journal = article.journal
print('ISSN:%s(%s),名称:%s,简称:%s' % (journal.issn, journal.issn_type, journal.title, journal.abbr))
ISSN:1532-5415(Electronic),名称:Journal of the American Geriatrics Society,简称:J Am Geriatr Soc
9. 获取文献发表在期刊的volume、issue信息
print('Volume:%s, Issue:%s' % (article.volume, article.issue))
Volume:68, Issue:9
10. 获取文献的引用信息
for reference in article.references:
print(reference.citation)
Loftfield E, Freedman ND, Dodd KW, et al. Coffee drinking is widespread in the United States, but usual intake varies by key demographic and lifestyle factors. J Nutr
. 2016;146:1762-1768.
...
11. 获取文献的发表日期
print(article.pubdate)
2020-09-01