red-black-tree-mod
Flexible python implementation of red black trees
What it is and what it does
Red-black-tree-mod provides two Python modules implementing red-black trees—a self-balancing binary search tree data structure. One module enforces uniqueness across keys, while the other allows duplicates. Both support set-like operations and dictionary-like operations for key-value storage and retrieval. Red-black trees guarantee consistent operation times with low standard deviation, making them useful when predictable performance matters.
The package is written in pure Python with no external runtime dependencies, so installation is straightforward from a dependency perspective. However, it has not been actively maintained for 962 days, and the source-only distribution means you should verify it works on your target Python version before relying on it in production.
Use it for:
- Implement ordered sets or dictionaries where insertion, deletion, and lookup must have predictable performance
- Build applications requiring balanced tree traversal with consistent operation times
- Use as a reference implementation or educational tool for understanding red-black tree algorithms
- Replace unordered dictionaries when key ordering and balanced performance are both needed
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python implementations of red-black trees with optional uniqueness enforcement, supporting both set-like and dictionary-like operations.
Yes, if you specifically need a red-black tree data structure and are willing to test it on your Python version. The MIT license is permissive, there are no known vulnerabilities, and it has no external dependencies. However, the dormant maintenance status and source-only distribution mean you should verify compatibility with your Python version before committing to production use.
Install
red-black-tree-mod on PyPI
pip
pip install red-black-tree-moduv
uv add red-black-tree-modpoetry
poetry add red-black-tree-modInstalling red-black-tree-mod
Before you install
High install friction from a source distribution. Package is dormant—last release was 962 days ago—with no recent maintenance signals visible.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for most projects.
Quickstart
pip install red-black-tree-mod
import red_black_tree
tree = red_black_tree.RedBlackTree()
tree[key] = value
Source distribution only; verify compatibility with your Python version before production use.
Verify before relying
- Whether the package actually works on modern Python versions despite claiming support for Python 2.x and 3.x
- Performance characteristics compared to standard library alternatives or other tree implementations
- Whether the uniqueness-enforcing variant is actively used or well-tested
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 962 days since the last release |
| First released | |
| Downloads | 3,653,641/month — #2,542 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: red-black-tree-mod-1.22.tar.gz
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
accumulation-treeImplements a red/black tree that stores partial…
permissive · top 15,000 on PyPI
intervaltreeA self-balancing interval tree data structure…
permissive · top 5,000 on PyPI
anytreeProvides a lightweight Python library for…
unclear · top 5,000 on PyPI
suffix-treesImplements suffix trees and generalized suffix…
permissive · top 15,000 on PyPI
crcmodComputes Cyclic Redundancy Check (CRC) values…
permissive · top 5,000 on PyPI
py_treespy_trees implements behaviour trees in Python,…
permissive · top 15,000 on PyPI
nutreeNutree provides a Python library for creating,…
permissive · top 5,000 on PyPI
zictProvides mutable mapping tools and data…
permissive · top 5,000 on PyPI
bloom-filter2A pure Python implementation of a Bloom…
permissive · top 15,000 on PyPI
aptedComputes the tree edit distance between two…
permissive · top 15,000 on PyPI