TreeSwift is a fast tree manipulation library for Python 2 and 3, providing a simple interface for reading, writing, and analyzing phylogenetic trees. The current version is 1.1.45, with regular updates and bug fixes.
pip install treeswiftVerified import paths — ran on the pinned version, not inferred.
Initialize a tree, read a Newick string, print the tree, and compute the distance between two leaves.
Use `extract_tree_with(set(['ABC']))` or `extract_tree_with(['ABC'])` to keep the label intact.
Pass an open file handle or a path; gzip is detected internally.
Upgrade to >=1.1.39: `pip install --upgrade treeswift`.
Run `pip install treeswift` in the correct Python environment.
Wrap the string in a list: `tree.extract_tree_with(['label'])` instead of `tree.extract_tree_with('label')`.No dependency data recorded yet.