I'd like to write a program to download some complete genome fasta files of a list of species from NCBI. However, when I use BioPython, I can not get the result I want.
from Bio import Entrez
Entrez.email = "firstname.lastname@example.org"
search_term = 'Acidaminococcus sp. D21'
handle = Entrez.esearch(db='nucleotide', term=search_term)
record = Entrez.read(handle)
ids = record['IdList']
ids will return lots of numbers and some of ids are not fasta files. Is there a better method to fetch exactly a file contain all contigs in a certain genome or at least automatically remove those ids whose corresponding files are not sequence files?