code: def convert_accession_to_taxid(self, accessionid):
          
          # Submit request to NCBI eutils/Taxonomy Database
          server = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" + self.options + "&db=nuccore&id={0}&retmode=xml".format(
              accessionid)
          r = requests.get(server, headers={"Content-Type": "text/xml"})
          if not r.ok:
              r.raise_for_status()
              sys.exit()
          # Process Request
          response = r.text
          records = xmltodict.parse(response)
          try:
              for i in records['GBSet']['GBSeq']['GBSeq_feature-table']['GBFeature']['GBFeature_quals']['GBQualifier']:
                  for key, value in i.items():
                      if value == 'db_xref':
                          taxid = i['GBQualifier_value']
                          taxid = taxid.split(':')[1]
                          return taxid
          except:
              for i in records['GBSet']['GBSeq']['GBSeq_feature-table']['GBFeature'][0]['GBFeature_quals']['GBQualifier']:
                  for key, value in i.items():
                      if value == 'db_xref':
                          taxid = i['GBQualifier_value']
                          taxid = taxid.split(':')[1]
                          return taxid
          return
docs: Convert Accession Id to Tax Id