text: user3555: I have a list of scientific names of species. Is there a python module that can fetch NCBI taxonomy IDs? 
  
  user3848: Biopython has an efetch frontend.
  from Bio import Entrez
  Entrez.email = "mg@example.edu" 
  handle = Entrez.efetch(db="nucleotide", id="KR052012.1", rettype="gb", retmode="text")
  print(handle.read())
  
  
  OUT
  LOCUS       KR052012               10714 bp    RNA     linear   VRL 09-MAY-2015
  DEFINITION  Dengue virus strain Hb33/CHN/2014, complete genome.
  ACCESSION   KR052012
  VERSION     KR052012.1
  KEYWORDS
  .... etc
  You will likely need to perform an EFetch search and then extract out the accession numbers for import (as done above)
  
  user96: 
  This isn't a Python library, but it's easily invoked from Python code, easy to install, and has a lot of useful features.
  
  I just discovered the amazing taxonkit library this week. In particular, the taxonkit name2taxid command seems to be what you're looking for.
  $ cat NAMES
  Polistes dominula
  Sinorhizobium meliloti
  Gossypium hirsutum
  $ cat NAMES | taxonkit name2taxid
  Polistes dominula       743375
  Sinorhizobium meliloti  382
  Gossypium hirsutum      3635
  
  Easily installed using conda install taxonkit.
  
original_text: 3555: <p>I have a list of scientific names of species. Is there a python module that can fetch <a href="https://www.ncbi.nlm.nih.gov/Taxonomy/TaxIdentifier/tax_identifier.cgi" rel="nofollow noreferrer">NCBI taxonomy IDs</a>? </p>
   3848: <p>Biopython has an efetch frontend.</p>
  <pre><code>from Bio import Entrez
  Entrez.email = &quot;mg@example.edu&quot; 
  handle = Entrez.efetch(db=&quot;nucleotide&quot;, id=&quot;KR052012.1&quot;, rettype=&quot;gb&quot;, retmode=&quot;text&quot;)
  print(handle.read())
  </code></pre>
  <hr />
  <p><strong>OUT</strong></p>
  <p>LOCUS       KR052012               10714 bp    RNA     linear   VRL 09-MAY-2015
  DEFINITION  Dengue virus strain Hb33/CHN/2014, complete genome.
  ACCESSION   KR052012
  VERSION     KR052012.1
  KEYWORDS<br />
  .... etc</p>
  <p>You will likely need to perform an EFetch search and then extract out the accession numbers for import (as done above)</p>
   96: <blockquote>
    <p><em>This isn't a Python library, but it's easily invoked from Python code, easy to install, and has a lot of useful features.</em></p>
  </blockquote>
  
  <p>I just discovered the amazing <a href="https://github.com/shenwei356/taxonkit/" rel="nofollow noreferrer">taxonkit library</a> this week. In particular, the <a href="https://bioinf.shenwei.me/taxonkit/usage/#name2taxid" rel="nofollow noreferrer"><code>taxonkit name2taxid</code> command</a> seems to be what you're looking for.</p>
  
  <pre><code>$ cat NAMES
  Polistes dominula
  Sinorhizobium meliloti
  Gossypium hirsutum
  $ cat NAMES | taxonkit name2taxid
  Polistes dominula       743375
  Sinorhizobium meliloti  382
  Gossypium hirsutum      3635
  </code></pre>
  
  <p>Easily installed using <code>conda install taxonkit</code>.</p>
  