Skip to main content

rs-avl for Python

PyPI PyPI downloads Python Publish PyPI License

A fast AVL ordered set backed by Rust, with support for arbitrary comparable Python objects.

Installation

pip install rs-avl

Comparable values

from rs_avl import AVLTree

tree = AVLTree([4, 2, 6, 1, 3, 5])
tree.insert(7)

assert list(tree) == [1, 2, 3, 4, 5, 6, 7]
assert tree.search(3) == 3
assert list(tree.range(2, 6)) == [2, 3, 4, 5]
assert list(tree.iter_from(3, 3)) == [3, 4, 5]
assert list(tree.iter_to(5, 3)) == [5, 4, 3]
assert list(tree.descending()) == [7, 6, 5, 4, 3, 2, 1]

Objects ordered by an attribute

from dataclasses import dataclass
from rs_avl import AVLTree

@dataclass
class Task:
    name: str
    priority: int

tasks = AVLTree(
    [Task("document", 2), Task("release", 1)],
    key="priority",
)

assert tasks.first().name == "release"
assert tasks.search_key(2).name == "document"

key can also be a callable, including a lambda returning a composite key:

tasks = AVLTree(key=lambda task: (task.priority, task.name))

Equal keys are treated as duplicates. Extracted keys should remain comparable for as long as their values are stored. Type information is included through a generated .pyi file and py.typed marker.

Serialization and pickling

AVLTree supports Python's pickle protocol out of the box. Unpickling uses an O(n) sorted builder that bypasses AVL insertion and Python key comparisons entirely — it allocates nodes directly and computes heights bottom-up. The key extractor (attribute name or callable) is preserved faithfully; a callable key must itself be picklable:

import pickle
from rs_avl import AVLTree

tree = AVLTree([3, 1, 2])
restored = pickle.loads(pickle.dumps(tree))
assert list(restored) == [1, 2, 3]

# With an attribute key
from dataclasses import dataclass

@dataclass
class Task:
    name: str
    priority: int

tasks = AVLTree([Task("release", 1), Task("document", 2)], key="priority")
restored_tasks = pickle.loads(pickle.dumps(tasks))
assert restored_tasks.first().name == "release"

License

Dual-licensed under your choice of GPL-3.0-only or Apache-2.0.

Release files for rs-avl 0.1.2

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

Source distribution (sdist)

Source distribution for rs-avl 0.1.2
File Size Uploaded
rs_avl-0.1.2.tar.gz 42.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for rs-avl 0.1.2
File
rs_avl-0.1.2-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details
rs_avl-0.1.2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
rs_avl-0.1.2-cp310-abi3-win32.whl CPython 3.10 abi3 Windows x86-32 Details
rs_avl-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
rs_avl-0.1.2-cp310-abi3-musllinux_1_2_i686.whl CPython 3.10 abi3 Linux musl 1.2+ x86-32 Details
rs_avl-0.1.2-cp310-abi3-musllinux_1_2_armv7l.whl CPython 3.10 abi3 Linux musl 1.2+ ARMv7l Details
rs_avl-0.1.2-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details
rs_avl-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
rs_avl-0.1.2-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.10 abi3 Linux glibc 2.17+ IBM System/390x Details
rs_avl-0.1.2-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.10 abi3 Linux glibc 2.17+ PowerPC 64-le Details
rs_avl-0.1.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.10 abi3 Linux glibc 2.17+ ARMv7l Details
rs_avl-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
rs_avl-0.1.2-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl CPython 3.10 abi3 Linux glibc 2.5+ x86-32 Details
rs_avl-0.1.2-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
rs_avl-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 5.5 MB

Release files / rs_avl-0.1.2.tar.gz

Download URL rs_avl-0.1.2.tar.gz
Size 42.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f9c1a290704f2dee7ca63430d136ea216528dfa604222e677bed8595dd4d5587
BLAKE2b-256 checksum
How to use checksums
36e7f52fe81de8dc20e30d9969667ecc8ec84de00401e0c6203c48bc9287ae02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-win_arm64.whl

Download URL rs_avl-0.1.2-cp310-abi3-win_arm64.whl
Size 179.1 kB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
b4dac9117e21a1dd4c3c1a2c48ee1501f890dd5d691085a89339889179f09f76
BLAKE2b-256 checksum
How to use checksums
ce83fb610ce7de7b38b69c791a42324a662b85c8ca2434a753394273ec0c220b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-win_amd64.whl

Download URL rs_avl-0.1.2-cp310-abi3-win_amd64.whl
Size 181.9 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
cc68218a93ebba20a0358f7ed9b814a69e52c547e11b18545a7b668d5cba2641
BLAKE2b-256 checksum
How to use checksums
2299577a748dcabb5ed99f4b5d1ddd0a4ab841b12ec94e234d804d3e45b3bb16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-win32.whl

Download URL rs_avl-0.1.2-cp310-abi3-win32.whl
Size 172.1 kB
Tags CPython 3.10 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
1482edd9684ce4682d6061814003b0232e2859b441696f8c7a69f5a9cfd0fa93
BLAKE2b-256 checksum
How to use checksums
355fdbc7c5b535198373caa6287e045d0ae462b8f69aa56de2eeb237b9041f4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL rs_avl-0.1.2-cp310-abi3-musllinux_1_2_x86_64.whl
Size 531.6 kB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
5bbfb18e1e8331fecd2a9fe84645af650a7324e45005f35b20e7c4505f24fc80
BLAKE2b-256 checksum
How to use checksums
eef97bf1c3fee054f30aae740381e320e811787e50b51a2a552ce2e70e07b0b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-musllinux_1_2_i686.whl

Download URL rs_avl-0.1.2-cp310-abi3-musllinux_1_2_i686.whl
Size 566.2 kB
Tags CPython 3.10 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
1179d1d4b2776701b152e9fc7052a372167b3c7739f2c8988fee9b78a9d087f3
BLAKE2b-256 checksum
How to use checksums
3e48e7548f1f445288f0995a2a2748c692ed86b3dfe0db1d71bd74a355f19e30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-musllinux_1_2_armv7l.whl

Download URL rs_avl-0.1.2-cp310-abi3-musllinux_1_2_armv7l.whl
Size 602.8 kB
Tags CPython 3.10 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
ea3f1d8a920da3bd5ff8b35379ad161575181e52e5d4009bf4b50b9ad258f16f
BLAKE2b-256 checksum
How to use checksums
214be916efd1e4e3636be77f01b71ca730049ee3155b02dd85c99b33453aff80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL rs_avl-0.1.2-cp310-abi3-musllinux_1_2_aarch64.whl
Size 502.8 kB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
1c2277445c40520df171b91d742fb45acc81dc395f2f16b06a65557fd972570b
BLAKE2b-256 checksum
How to use checksums
1ca0097f0fb2d75b52f332702446469d8b9579aa6e5597eb2fba997aaf73de1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rs_avl-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 328.0 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5a520bb27c1f10ff685f6a852ab24f4d4d66f66a11e5e1492308771e0a39eed2
BLAKE2b-256 checksum
How to use checksums
581457b4ce92930e5e3ddfbe9e303affd3f9bbc62c25deea987743740d5db1dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL rs_avl-0.1.2-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 344.1 kB
Tags CPython 3.10 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
f7a039a198a6796d00d3bbc82e21235ec6c14de61d7c2ca261473317387ad2f3
BLAKE2b-256 checksum
How to use checksums
05d8bc11439141c752ee301d2638c22e879c98018936b85c23e5650727fb89e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL rs_avl-0.1.2-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 444.4 kB
Tags CPython 3.10 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
d83dab614c9657308b5f8adc6edebb36ddaf7fe6ed93776f26820d62fb9f2ef7
BLAKE2b-256 checksum
How to use checksums
e00d2156c696d9664b44140fe5b1fd4c975a5eabd07d047f8df8b70896e8976f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL rs_avl-0.1.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 328.2 kB
Tags CPython 3.10 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
06bff25890e233b4ad2b5a85872afa35b3b00312acbe8660e14b2e2a8a47dc72
BLAKE2b-256 checksum
How to use checksums
17dbe677d8c1ed4d7c8f9c77c9b3a28de4e48e125a10f9c12a55b1ba1b39238d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL rs_avl-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 325.5 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
57536a3116e9a013411b39ba30bb4ec2a174c0a1dc06ac52e2d5f274a39c648d
BLAKE2b-256 checksum
How to use checksums
0f792b739f57814cf48a4ed4fd020c2243059f653e9ff1ea86197dda29db228e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl

Download URL rs_avl-0.1.2-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Size 348.5 kB
Tags CPython 3.10 Linux glibc 2.5+ x86-32 abi3
SHA-256 checksum
How to use checksums
24f85b6e86d81a1594f0722a70d6701ff7e8911c0314d5c595bc39b491d3434c
BLAKE2b-256 checksum
How to use checksums
96f284aab63084b83304f859640cc316943fc8a2307e5f2f1b95d26a992f24a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-macosx_11_0_arm64.whl

Download URL rs_avl-0.1.2-cp310-abi3-macosx_11_0_arm64.whl
Size 290.0 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3dedb0069e0aa7949b5a853dc7841d6d203645be8061bf20ad055fbcaeaea481
BLAKE2b-256 checksum
How to use checksums
6b3ff43ee5f0483712d326d2adb5f7a3a6ab5daf1ed65b7b7e699c8d5db1f363
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / rs_avl-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl

Download URL rs_avl-0.1.2-cp310-abi3-macosx_10_12_x86_64.whl
Size 288.7 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e8eca32086ced8a021e746cd22a7234076612ea790652e045bfd01354c413478
BLAKE2b-256 checksum
How to use checksums
8017bacb7f2b9ec2ac1f0313c9145233eb7d0552b839a8b71673c2ab020741ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

16 release 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