skillfed

suffix-trees

Suffix trees, generalized suffix trees and string processing methods

suffix-trees v0.3.0 90.6K downloads/30d#13,575 on PyPI126
Permissive license MIT Abandoned released

What it is and what it does

suffix-trees provides a Python implementation of suffix trees and generalized suffix trees, which are data structures that enable fast substring searching and pattern matching. You create a tree from a string or list of strings, then query it to find substrings, locate all occurrences of a pattern, or compute properties like the longest common substring across multiple strings.

The package is classified as Alpha and has been unmaintained since 2020. It has no external runtime dependencies, making installation simple, but its abandonment means there will be no fixes for compatibility issues with newer Python versions or performance improvements. It is suitable for educational purposes or as a reference implementation, but production use should consider whether the lack of maintenance poses a risk for your use case.

Use it for:

  • Find all occurrences of a substring within a text string using the find_all method.
  • Compute the longest common substring across multiple strings using generalized suffix trees.
  • Build a suffix tree index for repeated substring searches on a fixed text.
  • Implement text processing algorithms that rely on efficient substring matching.
  • Educational exploration of suffix tree data structures and their applications.

Worth the install?

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

Implements suffix trees and generalized suffix trees in Python, providing data structures for efficient string searching and pattern matching with methods for common applications like longest common substring detection.

Yes, if you need a reference implementation for learning suffix trees or have a simple, non-critical use case for substring matching. No, if you require active maintenance or production-grade performance guarantees. The package works but is abandoned, so evaluate whether its lack of updates aligns with your project's stability requirements.

Install

suffix-trees on PyPI

pip

pip install suffix-trees

uv

uv add suffix-trees

poetry

poetry add suffix-trees

Installing suffix-trees

Before you install

Installation is straightforward with no runtime dependencies, but the package is abandoned as of 2020 with no recent maintenance. The repository is archived and the last commit was 2020-08-05, so expect no bug fixes or compatibility updates.

License in practice

Licensed under MIT, a permissive license that allows free use, modification, and distribution with minimal restrictions, making it safe to use in most projects.

Quickstart

pip install suffix-trees

from suffix_trees import STree

st = STree.STree("abcdefghab")
print(st.find("abc"))  # 0
print(st.find_all("ab"))  # [0, 8]

Verify before relying

  • Whether the implementation handles edge cases and large datasets efficiently.
  • Compatibility with Python versions beyond 3.8, given the package is abandoned.
  • Performance characteristics and memory usage for typical use cases.

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 2,317 days since the last release
Last repo commit (repository archived)
First released
Downloads 90,566/month — #13,575 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: suffix_trees-0.3.0-py3-none-any.whl

Development Status :: 3 - AlphaProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8

Tags

suffix tree implementationstring pattern matchinglongest common substringgeneralized suffix treestext search data structuresubstring findingstring algorithms
data-structuresstring-algorithmseducational

More Text Processing packages