I'm trying to use Python
and Biopython
to fetch metadata for a given assembly identifier. In this case I'm looking for GCF_000005845.2
from Bio import Entrez
# GCF_000005845.2
id_ecoli = "GCF_000005845.2"
esummary_handle = Entrez.esummary(db="assembly", id=id_ecoli, report="full")
record = Entrez.read(esummary_handle, validate=False)
record
# DictElement({'DocumentSummarySet': DictElement({'DocumentSummary': []}, attributes={'status': 'OK'})}, attributes={})
This is the type of data I'm looking for below: https://www.ncbi.nlm.nih.gov/assembly/GCF_000005845.2/
I could make a HTML scraper but I don't want to reinvent the wheel if there is already something available.
handle = Entrez.efetch(db="assembly", id="GCF_000005845.2") record = Entrez.read(handle) record
['5845', '2']