如何使用Bio.Entrez提取PMC文章标题和摘要的完整列表?

2024-04-29 07:29:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图从PMC/Pubmed下载完整的标题/摘要数据。这是一个由来已久的问题,但stackoverflow的所有答案似乎都无法回答

一般的方法是使用Entrez包,但同样,您需要指定搜索词。此外,您可以随时间发送的查询请求也有限制

from Bio import Entrez
Entrez.email = "A.N.Other@example.com"  
handle = Entrez.esearch(db="pubmed", term="orchid", retmax=463)
record = Entrez.read(handle)
handle.close()
idlist = record["IdList"]
handle = Entrez.efetch(db="pubmed", id=idlist, rettype="medline", retmode="text")
records = Medline.parse(handle)

for record in records:
     print("title:", record.get("TI", "?"))
     print("authors:", record.get("AU", "?"))
     print("source:", record.get("SO", "?"))
     print("")

我是否可以使用Python或直接从任何其他来源从PMC下载整篇文章+抽象数据


Tags: 数据标题dbgetentrezrecordstackoverflowhandle