apted
APTED algorithm for the Tree Edit Distance
Decision gist · record as of 2026-08-14
Yes, if you need tree edit distance and can accept an abandoned package. The algorithm is well-established and marked Production/Stable with no known vulnerabilities. Install friction is low and the MIT license is unencumbered. However, verify compatibility with your Python version—the last tested versions were 2.7, 3.4, 3.5, and 3.6, and no updates have been released since 2017.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Trees must be provided as objects with a 'name' attribute for labels and a 'children' attribute for child nodes, or a custom Config class must be supplied to define tree structure and comparison logic.
- Install friction is low with no runtime dependencies.
- However, the package is abandoned—last commit was 2017-11-08 and no updates have been released since.
License · maintenance · safety
MIT (permissive) — Published under the MIT license, which is permissive and places no restrictions on use, modification, or distribution in commercial or private projects.
last release 2017-11-08 (3201 days) · last repo commit 2017-11-08 · 102 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 381,978 downloads/mo, #7,093 on PyPI
Alternatives
Verify before relying
pip install apted
from apted import APTED, Config
apted = APTED(tree1, tree2, Config())
distance = apted.compute_edit_distance()
mapping = apted.compute_edit_mapping()- Whether the package works correctly on Python versions released after 3.6
- Whether bracket notation is the only supported input format or if other tree representations are supported
- Performance characteristics on large trees or production workloads
What it is and what it does
APTED is a Python port of the state-of-the-art APTED algorithm for computing tree edit distance—the minimum cost of transforming one tree into another. It accepts trees in bracket notation (e.g., {A{B{X}{Y}{F}}{C}}) and outputs both the edit distance value and a mapping showing which nodes correspond between the source and destination trees. Nodes without a mapping are treated as deletions or insertions.
The package supports customization through Config classes, allowing you to define custom tree structures, label comparisons, and operation costs. It can also track edit mappings during execution via meta_chained_config, though this uses more memory. The implementation has no external runtime dependencies, making it straightforward to install and integrate.
Use it for
- Measure structural similarity between hierarchical documents by computing edit distance on tree representations
- Compare abstract syntax trees to detect structural changes or refactoring between code versions
- Align hierarchical data structures in bioinformatics or phylogenetics where tree comparison is needed
- Detect changes in nested data structures for version control or diff purposes
- Implement tree-based clustering or classification by using edit distance as a similarity metric
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need tree edit distance and can accept an abandoned package.
The algorithm is well-established and marked Production/Stable with no known vulnerabilities. Install friction is low and the MIT license is unencumbered. However, verify compatibility with your Python version—the last tested versions were 2.7, 3.4, 3.5, and 3.6, and no updates have been released since 2017.
Install
apted on PyPI
Before you install
Install friction is low with no runtime dependencies. However, the package is abandoned—last commit was 2017-11-08 and no updates have been released since.
Trees must be provided as objects with a 'name' attribute for labels and a 'children' attribute for child nodes, or a custom Config class must be supplied to define tree structure and comparison logic.
License in practice
Published under the MIT license, which is permissive and places no restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install apted
from apted import APTED, Config
apted = APTED(tree1, tree2, Config())
distance = apted.compute_edit_distance()
mapping = apted.compute_edit_mapping()
Verify before relying
- Whether the package works correctly on Python versions released after 3.6
- Whether bracket notation is the only supported input format or if other tree representations are supported
- Performance characteristics on large trees or production workloads
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 3,201 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 381,978 / month, #7,093 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Topic :: Software Development :: Build Tools |
Evidence: apted-1.0.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “tree edit distance”
- aptedComputes the tree edit distance between two trees using the APTED…
- zssComputes the edit distance between two tree structures using the…
- pyxDamerauLevenshteinComputes Damerau-Levenshtein edit distance between sequences using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also zss · textdistance · editdistance · strsimpy · edlib · intervaltree · editdistpy · python-Levenshtein · fastdtw · kaldialign