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, most 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 .

or on Windows with the launcher:

py -m pip install .

Development

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

You must install from the repository in development mode:

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

Then you can run the tests with:

python -m unittest discover

Wheel format

The extension module only uses the so-called limited API. The binary wheel is expected to be compatible with any Python version above 3.7 for the same architecture. Currently, it is only provided for a Windows 64 bits platform.

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

Metadata

Release files for pyrbtree 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrbtree 0.6.1
File Size Uploaded Provenance Actions
pyrbtree-0.6.1.tar.gz 15.1 kB Without provenance Details for pyrbtree-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyrbtree 0.6.1
File Interpreter ABI Platform Actions
pyrbtree-0.6.1-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details for pyrbtree-0.6.1-cp37-abi3-win_amd64.whl

Total release size: 29.3 kB

Release files / pyrbtree-0.6.1.tar.gz

Download URL pyrbtree-0.6.1.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
56cd5c58f430d38970c7fc713b01cbee804c22d9a10bb36d40f6ccf75a49d617
BLAKE2b-256 checksum
How to use checksums
534b78e3210db899f0d7953385eb7faaeca026a0f8ba4fb02c3e31fd9dd5d363
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release files / pyrbtree-0.6.1-cp37-abi3-win_amd64.whl

Download URL pyrbtree-0.6.1-cp37-abi3-win_amd64.whl
Size 14.1 kB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b057399f561969125f57f947719a99fba18e5184c01cb27b8d575a70e701d65d
BLAKE2b-256 checksum
How to use checksums
f2fa92e5807dc4f333adbb6dbb0753cb3e9f8880e0362a4d9187e54118a0d2a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Security for pyrbtree 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files No provenance

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