myShelve = shelve.open('Mus_musculus.GRCm38.dna.primary_assembly.db')
with open('Mus_musculus.GRCm38.dna.primary_assembly.fa') as handle:
    for i, record in enumerate(SeqIO.parse(handle, 'fasta')):
        myShelve.update([(str(record.id), str(record.seq))])
Shelve dictionary size is >100Gb for a 2Gb text file