Skip to main content

pyrbtree

Description

This package provides an implementation of a tree based set and mapping. For performance reasons, it uses an underlying binary extension wrapping a C library: CRBTree.

Usage

The package declares 2 classes: TreeSet, which behaves as a normal set, but maintains a natural order thanks to the underlying Red-Black tree, and TreeMap which is the same as a mapping.

At the time of this writing, all methods from set and dict should work as expected, except for copy which is currently not implemented.

Example:

from pyrbtree import TreeSet

ts = TreeSet('acbfd')
ts.add('e')
print(ts)

should output:

{'a', 'b', 'c', 'd', 'e', 'f'}

Installation

From PyPI

pip install pyrbtree

From Github

This is the recommended way if you want to contribute or simply tweak pyrbtree to your own requirements. You can get a local copy by downloading a zipfile but if you want to make changes, you should rather clone the repository to have access to all git goodies:

git clone https://github.com/s-ball/pyrbtree.git --recurse-submodules

You can then install it in your main Python installation or in a venv with:

pip install -e .

or on Windows with the launcher:

py -m pip install -e .

Development

The GitHub repository contains an unittest test package. From the main folder, tests can be launched with:

python -m unittest discover

Contributions

Contributions are welcome, including issues on GitHub. Problems are expected to be documented so that they can be reproduced. But I only develop this on my free time, so I cannot guarantee quick answers...

Disclaimer: alpha quality

The main classes are already well tested, but the copy method is still to be implemented.

License

This work is licenced under a MIT Licence. See LICENSE.txt

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrbtree-0.5.1.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrbtree-0.5.1-cp310-cp310-win_amd64.whl (22.1 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file pyrbtree-0.5.1.tar.gz.

File metadata

  • Download URL: pyrbtree-0.5.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for pyrbtree-0.5.1.tar.gz
Algorithm Hash digest
SHA256 3ab4991b2a0cf36aa575b0eaa709798c95fb08cb60827f66addfbf1edfab6974
MD5 7e7fe07f28e0ab07bf077e43ce0c5d8b
BLAKE2b-256 6baca724711bb83689c5e6c2fd7a7c614f785dd00f27b1dceba6263eac66ca03

See more details on using hashes here.

File details

Details for the file pyrbtree-0.5.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyrbtree-0.5.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for pyrbtree-0.5.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 77c3164dce9122a5218e6587a057f6f67ee5cb68941c611a10f50343b61c86ae
MD5 4b4566794a52090bc55ae5a8a6957cfe
BLAKE2b-256 8f432c903776c61c835e2a8a1ff035e40946956893b3b610a8f3fe042d533618

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.1

2 files

This release

0.5.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page