skillfed

zss

Tree edit distance using the Zhang Shasha algorithm

zss v1.2.0 306.7K downloads/30d#7,782 on PyPI459
License unclear Abandoned released

What it is and what it does

zss implements the Zhang-Shasha algorithm for computing tree edit distance—a measure of how many insertions, deletions, and relabelings are needed to transform one tree into another. It provides a default Node class and edit distance function for convenience, but also accepts custom tree formats and distance metrics via callback functions.

The package is designed for comparing hierarchical structures where you need a numeric similarity or difference score. It has no runtime dependencies by default, though optional dependencies (editdist for string-based label comparison, numpy for performance) can be installed. However, the package has been abandoned since 2018 and is no longer maintained, creating risk around compatibility with modern Python and dependency versions.

Use it for:

  • Compare abstract syntax trees (ASTs) from different code versions to measure structural changes
  • Measure similarity between XML or JSON document structures for data reconciliation
  • Detect structural differences in parse trees for natural language processing tasks
  • Quantify changes in hierarchical data models or organizational structures over time

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Computes the edit distance between two tree structures using the Zhang-Shasha algorithm, with support for custom node formats and distance metrics.

No. The package is abandoned (last release 2018, last commit 2020) with unclear licensing and unspecified Python support. While the algorithm is sound and there are no known vulnerabilities, the lack of maintenance creates compatibility risk with modern Python versions and dependency ecosystems. Consider maintained alternatives or implementing Zhang-Shasha directly if tree edit distance is critical to your project.

Install

zss on PyPI

pip

pip install zss

uv

uv add zss

poetry

poetry add zss

Installing zss

Before you install

High install friction: the package is abandoned (last release March 2018, last commit October 2020) with no declared runtime dependencies but requires compilation from source. No active maintenance.

License in practice

License status is unclear—no SPDX identifier or raw license text provided. Verify licensing terms before use in proprietary or copyleft-sensitive projects.

Quickstart

from zss import simple_distance, Node

A = Node("f").addkid(Node("a")).addkid(Node("e"))
B = Node("f").addkid(Node("a")).addkid(Node("e"))
dist = simple_distance(A, B)
print(dist)

Package is abandoned with no active maintenance; Python version support is unspecified and may not work on modern Python versions.

Verify before relying

  • Compatibility with Python 3.10+ and current NumPy/editdist versions
  • Whether optional dependencies (editdist, numpy >= 1.7) are still installable and functional
  • Actual license terms (no SPDX or raw license text in metadata)

Package facts

License not declared (unclear)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 3,077 days since the last release
Last repo commit
First released
Downloads 306,742/month — #7,782 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: zss-1.2.0.tar.gz

Tags

tree edit distancezhang shasha algorithmtree comparison distancetree similarity metricstructural tree difftree alignment distancenode-based tree metrics
tree-algorithmsedit-distanceabandoned

More Scientific/Engineering packages