Can you tell me how I can obtain the 5 newest articles from PubMed that contain the word 'obesity' and return the authors, the title, the date, doi and PubMed PMID of each paper using Python? Thank you in advance
EDIT:
My try so far. I believe this is the wanted result but i need to obtain the correct pubmed ids in order to run the function
from Bio.Entrez import efetch
from Bio import Entrez
Entrez.email = 'name@example.com'
def print_abstract(pmid):
handle = efetch(db='pubmed', id=pmid, retmode='text', rettype='abstract')
print(handle.read())
print_abstract(pmid)