Package: ncbiparser
1. NCBI-ParserSearch any term from all NCBI databases to obtain matched entries, and download all NCBI GenBank format files and sequences corresponding to accessory number in genbank directory, finally  export all Species Latin names, Accessory Number, Sequence Length, Division, Collection Country, Collection Date, Collected Worker, Identified Worker, and Reference information, etc. of the search records as tabular files.Developer:https://github.com/benben-miaoGithub:https://github.com/benben-miao/NCBI-ParserPyPI:https://pypi.org/project/ncbiparser/2. Usage# Install the packagepipinstallncbiparser# Run the command internallyncbiparser--help
Usage:ncbi-parser.exe[OPTIONS]Description:SearchanytermfromallNCBIdatabasestoobtainmatchedentries,anddownloadallNCBIGenBankformatfilesandsequencescorrespondingtoaccessorynumberingenbankdirectory,finallyexportallSpeciesLatinnames,AccessoryNumber,SequenceLength,Division,CollectionCountry,CollectionDate,CollectedWorker,IdentifiedWorker,andReferenceinformation,etc.ofthesearchrecordsastabularfiles.1.Getoptionsandparametershelp:ncbiparser--help2.Example(simpleinformation).Usersonlyneedtoinputthesearchterm,andthedefaultsearchisinNCBInucleotidedatabase:ncbiparser--term"Acanthopagrus 16S"--outputresults.xls3.Example(completeinformation).SpecifytheNCBIdatabasetype,inputthesearchterm,specifythenumberofrecordstodownloadandextract,andsuggestsettingalargerparametermax_record:ncbiparser--db_typenucleotide--term"Acanthopagrus 16S"--max_record500--res_typegb--outputresults.xls

Options:--db_typeTEXTPleaseinputNCBIdatabasetype,default:"nucleotide",including:[pubmed,protein,nuccore,ipg,nucleotide,structure,genome,annotinfo,assembly,bioproject,biosample,blastdbinfo,books,cdd,clinvar,gap,gapplus,grasp,dbvar,gene,gds,geoprofiles,homologene,medgen,mesh,ncbisearch,nlmcatalog,omim,orgtrack,pmc,popset,proteinclusters,pcassay,protfam,pccompound,pcsubstance,seqannot,snp,sra,taxonomy,biocollections,gtr][required]--termTEXTPleaseinputsearchtermcontent,default:"Acanthopagrus16S"[required]--max_recordTEXTPleaseinputmaxrecordnumber,default:"100",upto:10000[required]--res_typeTEXTPleaseinputresulttype,default:"gb",including:["gb","fasta","gbwithparts","gbcoll"]--outputTEXTPleaseinputoutputfullname(path+name+extension).default="results.xls"--helpShowthismessageandexit.3. NCBI GenBank formatLOCUSLC6491521081bpDNAlinearVRT03-SEP-2021
DEFINITIONAcanthopagrusbifasciatusKuroshioBiologicalResearchFoundationKBF-I361mitochondrialgenesfor12SrRNA,tRNA-Val,16SrRNA,partialandcompletesequence.
ACCESSIONLC649152
VERSIONLC649152.1
KEYWORDS.
SOURCEmitochondrionAcanthopagrusbifasciatus(twobarseabream)ORGANISMAcanthopagrusbifasciatusEukaryota;Metazoa;Chordata;Craniata;Vertebrata;Euteleostomi;Actinopterygii;Neopterygii;Teleostei;Neoteleostei;Acanthomorphata;Eupercaria;Spariformes;Sparidae;Acanthopagrus.
REFERENCE1AUTHORSSado,T.,Fukuchi,T.andMiya,M.TITLEReferencedataforMiFishmetabarcodinganalysisJOURNALUnpublished
REFERENCE2(bases1to1081)AUTHORSSado,T.,Fukuchi,T.andMiya,M.TITLEDirectSubmissionJOURNALSubmitted(27-AUG-2021)Contact:TetsuyaSadoNaturalHistoryMuseum&Institute,Chiba;955-2Aoba-cho,Chuo-ku,Chiba,Chiba260-8682,JapanURL:http://www2.chiba-muse.or.jp/NATURAL/
FEATURESLocation/Qualifierssource1..1081/organism="Acanthopagrus bifasciatus"/organelle="mitochondrion"/mol_type="genomic DNA"/specimen_voucher="Kuroshio Biological Research FoundationKBF-I 361"/db_xref="taxon:767411"/PCR_primers="fwd_name: L-708-12S, fwd_seq:ttayacatgcaagtatccgc, rev_name: H-1784-16SG, rev_seq:ttcagctttcccttgcggtac"rRNA<1..894/product="12S ribosomal RNA"tRNA895..967/product="tRNA-Val"rRNA968..>1081/product="16S ribosomal RNA"ORIGIN1acccccgtgaaaatgccctacagttccccgcccggaaacaaggagccggtatcaggcaca61ttcaatttagcccacgacaccttgctcagccacaccctcaagggtactcagcagtgataa121accttgacacataagtgaaaacttgaatcagttaaagctaagtagggccggtaaaactcg181tgccagccaccgcggttatacgagaggcccaagttgttagaaatcggcgtaaagggtggt241taagaataagattaaaattaaagccgaacatctttagtagctgttatacgctttcaaaga301caagaagcccaactgcgaaagtagctttatattttctgaacccacgaaagctaaggtaca361aactgggattagataccccactatgcttagccgtaaacatcgacagtttattacattttc421tgtccgcctgggtactacaagcattagctcaaaacccaaaggacttggcggtgctttaga481cccacctagaggagcctgttctagaaccgatattccccgttcaacctcacctctccttgc541ctctcagcctatataccgccgtcgttcagcttaccctgtgaagggcaaaaagtaagcaaa601attggcactgcccagtacgtcaggtcgaggtgtagtcaatggagtgggaagaaatgggct661acattcccttgtcttcagggaactacgaatggtgcactgaaaatgtgtgcctgaaggagg721atttagcagtaagtagtaatttagaatattctactgaagccggctcttaagcgcgcacac781accgcccgtcactctccccgagactttaaattcacattaactaaaatattaaatatcata841gaggggaggcaagtcgtaacatggtaagtgtaccggaaggtgtacttggaaaaccagcgc901atagctaaactagataaagcacctcccttacactgagaagatattcgtgcaaatcgaatt961gccctgagcctatcagctagccctctaacaaaaaacaacacacccccatcaattaacccc1021caatgcacttacattaaattaaacaaatcatttttccacccaagtatgggcgacagaaaa1081g
//4. Click usageimportclick@click.command()@click.option('--db_type',type=str,default="nucleotide",required=True,nargs=1,help='Please input NCBI database type, default: "nucleotide", including: [pubmed, protein, nuccore, ipg, nucleotide, structure, genome, annotinfo, assembly, bioproject, biosample, blastdbinfo, books, cdd, clinvar, gap, gapplus, grasp, dbvar, gene, gds, geoprofiles, homologene, medgen, mesh, ncbisearch, nlmcatalog, omim, orgtrack, pmc, popset, proteinclusters, pcassay, protfam, pccompound, pcsubstance, seqannot, snp, sra, taxonomy, biocollections, gtr]')@click.option('--term',type=str,default="",required=True,nargs=1,help='Please input search term content, default: "Acanthopagrus 16S"')@click.option('--max_record',type=str,default="100",required=True,nargs=1,help='Please input max record number, default: "100", up to: 10000')@click.option('--res_type',type=str,default="gb",required=False,nargs=1,help='Please input result type, default: "gb", including: ["gb", "fasta", "gbwithparts", "gbcoll"]')@click.option('--output',type=str,default="results.xls",nargs=1,help='Please input output full name (path + name + extension). default="results.xls"')defrun(db_type,term,max_record,res_type,output):"""Description:Search any term from all NCBI databases to obtain matched entries, and download all NCBI GenBank format files and sequences corresponding to accessory number in genbank directory, finally export all Species Latin names, Accessory Number, Sequence Length, Division, Collection Country, Collection Date, Collected Worker, Identified Worker, and Reference information, etc. of the search records as tabular files. \n1. Get options and parameters help: \nncbi-parser --help \n2. Example (simple information). Users only need to input the search term, and the default search is in NCBI nucleotide database: \nncbi-parser --term "Acanthopagrus 16S" --output results.xls \n3. Example (complete information). Specify the NCBI database type, input the search term, specify the number of records to download and extract, and suggest setting a larger parameter max_record: \nncbi-parser --db_type nucleotide --term "Acanthopagrus 16S" --max_record 500 --res_type gb --output results.xls \n"""results_file=output5. Pyinstaller usagemambacreate-nncbiparserpython=3.8
condaactivatencbiparser

whichpython
pipinstallbiopythonclick
pythonncbiparser.py--help

pipinstallpyinstaller
pyinstall-Fncbiparser.py-ifavicon.ico6. Package and publishncbiparserto PyPI6.1 Create setup.py file#!/usr/bin/python# _*_ coding:utf-8 _*_fromsetuptoolsimportsetup,find_packages### 1. Read the README.md contentsfromosimportpaththis_directory=path.abspath(path.dirname(__file__))withopen(path.join(this_directory,'README.md'),encoding='utf-8')asf:long_description=f.read()readme='ncbiparser/README.md'### 2. Setup the package configuresetup(# 2.1 Package informationname="ncbiparser",version="1.0.0",url="https://github.com/benben-miao/NCBI-Parser",keywords=["CLI","Biology","NCBI","Parser"],description="Search and fetch the Species Latin names, Accessory Number, Sequence Length, Division, Collection Country, Collection Date, Collected Worker, Identified Worker, and Reference information, etc. of the search records as tabular files.",long_description=long_description,long_description_content_type='text/markdown',download_url="https://pypi.org/project/ncbi-parser",# 2.2 Developer informationauthor="benben-miao",author_email="benben.miao@outlook.com",maintainer="benben-miao",maintainer_email="benben.miao@outlook.com",license="MIT License",# 2.3 Package configure# include_package_data=True,platforms="any",install_requires=['biopython','click'],# packages=find_packages(),packages=['ncbiparser'],entry_points={'console_scripts':['ncbiparser=ncbiparser.ncbiparser:run']},classifiers=["Programming Language :: Python :: 3","Operating System :: OS Independent",],data_files=[readme],# package_data={#     '':['examples/*.xlsx']# },include_package_data=True# exclude_package_data={# })### 3. Package build, test and publish# 3.1 Install setuptools with wheel and twine# pip install --upgrade setuptools wheel twine# 3.2 Check the setup.py content# python setup.py check# 3.2 Build source code tarball# python setup.py sdist# 3.3 Build wheel package and test# python setup.py bdist_wheel# pip install dist\*.whl# 3.4 Test package and uninstall test version# ncbiparser --help# pip uninstall ncbiparser# 3.5 Publish the package to PyPI# twine upload dist/*6.2 Create the MANIFEST.in fileinclude *.py *.md
recursive-include examples *.sh *.py *.ipynb *.txt *.xlsx *.gbk *.fasta *.seq6.3 Commands### 3. Package build, test and publish# 3.1 Install setuptools with wheel and twinepipinstall--upgradesetuptoolswheeltwine# 3.2 Check the setup.py contentpythonsetup.pycheck# 3.2 Build source code tarballpythonsetup.pysdist# 3.3 Build wheel package and testpythonsetup.pybdist_wheel
pipinstalldist\*.whl# 3.4 Test package and uninstall test versionncbiparser--help
pipuninstallncbiparser# 3.5 Publish the package to PyPItwineuploaddist/*