code: def main():
      
      # Get commandline args		
      args = get_args()
  	
      # Instantiate the ete NCBI taxa object
      ncbi = NCBITaxa(dbfile=args.database)
      ## dbfile location
      if args.verbose > 1:
          sys.stderr.write('Taxa database is stored at {}\n'.format(ncbi.dbfile))
  
      # Update the database if required.
      if args.update is True:
          if args.verbose > 1:
              msg = 'Updating the taxonomy database. This may take several minutes...\n'
              sys.stderr.write(msg)
          ncbi.update_taxonomy_database()
              
      # If names were provided in taxid list, convert to taxids
      args.taxid = args.taxid.replace('"', '').replace("'", '').split(',')
      args.taxid = name2taxid(args.taxid, ncbi)
  
      # Output
      if args.outfile is None:
          outFH = sys.stdout
      else:
          outFH = open(args.outfile, 'w')
      ## header
      if args.taxon_info:
          outFH.write('\t'.join(['name', 'taxid', 'rank', 'lineage']) + '\n')
      elif not args.just_taxids:
          outFH.write('\t'.join(['parent_taxid',
                                 'descendent_taxid',
                                 'descendent_name']) + '\n')
      ## body
      for taxid in args.taxid:
          if args.taxon_info:
              taxon_info(taxid, ncbi, outFH)
          else:
              desc_taxa(taxid, ncbi,  outFH, args.just_taxids)
              
      outFH.close()
docs: Make queries against NCBI Taxa databases