from Bio import Entrez
from Bio import SeqIO
key_list=['NZ_LFWC01000004.1'] ###Add all your IDs
for key in key_list:
Entrez.email = "myemailaddress"
handle = Entrez.efetch(db='nucleotide', id=key, rettype='gb')
record = SeqIO.read(handle,'genbank')
if record.features[0].qualifiers['db_xref'][0].split(":")[0] == 'taxon':
print(record.features[0].qualifiers['db_xref'])[0].split(":")[1]
If you have a very long list of RefSeq IDs, you might want to do a local search vs "accession2taxid" files, see : Biostars
Wonderful, that is exactly what I was looking for. Thank you so much.
Python and entrez module ?