Python library for NCBI taxonomy database.
Project description
TaxTree: Python library for NCBI taxonomy database
Supported features:
- download data from NCBI automatically.
- use SQLite and SQLAlchemy to persist data.
- retrieve ancestor taxonomy in any rank.
installation
pip install taxtree
usage
initialize database
Just run:
taxtree
- All data were saved to
~/.taxtree
- Downloaded
taxdmp.zip
path:~/.taxtree/taxdmp.zip
- Persistent data file path:
~/.taxtree/taxtree.db
search taxonomy
from taxtree import get_scoped_session, Tax
with get_scoped_session() as session:
tax = session.query(Tax).filter_by(tax_id='9606').first()
get ancestor
from taxtree import get_scoped_session, Tax, KINGDOM, PHYLUM
with get_scoped_session() as session:
tax = session.query(Tax).filter_by(tax_id='9606').first()
kingdom_tax = tax.get_ancestor(KINGDOM)
phylum_tax = tax.get_ancestor(PHYLUM)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
taxtree-1.0.4.tar.gz
(4.1 kB
view hashes)
Built Distributions
taxtree-1.0.4-py2.7.egg
(3.6 kB
view hashes)