`$ pip install biopython`
python
from Bio import Entrez
Entrez.email = "your@email.com"
python
handle = Entrez.esearch(db="pubmed", term="cancer")
record = Entrez.read(handle)
handle.close()
python
handle = Entrez.efetch(db="protein", id="12345678", rettype="gb", retmode="text")
data = handle.read()
handle.close()
python
from Bio import Entrez
Entrez.email = "your@email.com"
def get_sequence(accession_num):
handle = Entrez.efetch(db="nucleotide", id=accession_num, rettype="fasta", retmode="text")
data = handle.read()
handle.close()
return data
gene_accession = "NM_001101.3"
sequence = get_sequence(gene_accession)
print(sequence)