Registry / data / dendropy

dendropy

JSON →
library5.0.8pypypi✓ verified 86d ago

A Python library for phylogenetics and phylogenetic computing: reading, writing, simulation, processing and manipulation of phylogenetic trees (phylogenies) and characters. Current version 5.0.8 (requires Python >=3.7). The library has undergone major API changes from v4 to v5 (e.g., removal of deprecated modules, new tree structure classes). Release cadence is irregular, with v5.0.0 released in late 2023 and subsequent bugfix releases.

pip install dendropy
INSTALL
IMPORT
SIG · DENDROPY
D
dendropy
datapythonv5.0.8
Install
2.0s avg
Import
261ms
Disk
24MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.0.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.266s · 21.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.0s · import 0.256s · 22MB
24MB installed
● package 24MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Tree
from dendropy import Tree
from dendropy.tree import Tree
Tree class is now directly available under dendropy (since v4). Using dendropy.tree is deprecated and may be removed.
TaxonNamespace
from dendropy import TaxonNamespace
from dendropy.datamodel import taxonmodel
TaxonNamespace is now directly under dendropy; the old path was restructured in v5.

Load a tree from a Newick file and print it.

import dendropy tree = dendropy.Tree() # Read from a file (Newick example) tree = dendropy.Tree.get(path='example.tre', schema='newick') print(tree.as_string(schema='newick'))
Debug
Known issues
breakingDendroPy v5 introduced breaking changes: removal of deprecated modules (e.g., 'dendropy.utility', 'dendropy.dataio') and renaming of some classes. Code written for v4 may not work directly.
fix
Update imports to use the new 'dendropy' top-level namespace. Refer to migration guide on GitHub.
affects: <5.0.0
gotchaWhen reading trees, ensure the schema argument matches the file format exactly (e.g., 'newick', 'nexus', 'nexml'). Incorrect schema often leads to 'No tree found' or parsing errors.
fix
Double-check the file format and use the correct schema string. For example, use schema='nexus' for NEXUS files.
affects: all
Errors
Common errors & fixes
dendropy.exception.DendroPyError: No trees found in file.
Incorrect schema argument or file contains no trees (e.g., only taxon definitions).
fix
Specify the correct schema, e.g., Tree.get(..., schema='nexus') for NEXUS files. Ensure file contains tree data.
AttributeError: module 'dendropy' has no attribute 'tree'
Old code trying to access 'dendropy.tree' directly (v4 pattern). 'tree' is no longer a submodule; use 'dendropy.Tree'.
fix
Replace 'dendropy.tree' with 'dendropy.Tree'.
Upgrade
Version history
5.0.8latest on PyPI · released Jun 4, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
dendropy — pip install dendropy · libregistry