skillfed

red-black-tree-mod

Flexible python implementation of red black trees

red-black-tree-mod v1.22 3.7M downloads/30d#2,542 on PyPI
Permissive license MIT DORMANT released

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-mod

uv

uv add red-black-tree-mod

poetry

poetry add red-black-tree-mod

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 2Programming Language :: Python :: 3

Tags

red-black tree implementationbalanced binary search tree pythonself-balancing tree data structureordered set dictionary pythontree data structure library
data-structuresalgorithms

More Software Development packages