paged-collections
Paged sparse sets, maps, a priority queue and stable-address containers for
Rust (no_std + alloc), with Python bindings built on PyO3 and NumPy.
- Paged index: a key-indexed table split into pages allocated on first
use, so index pages follow the occupied key ranges. The default
Flatdirectory still holds one pointer per page up to the largest key; for keys spread over a wide range, theRadixandTreedirectories avoid that. - Paged storage: elements keep their addresses as the container grows.
Install
cargo add paged-collections # features: std (default), serde, concurrent
pip install paged-collections # Python 3.10+, NumPy 1.24+
Wheels cover CPython 3.10+ (abi3) and free-threaded 3.14t and 3.15t+.
See Installation.
Example
Rust:
use paged_collections::direct_map::PagedDirectMap;
use paged_collections::hive::Hive;
use paged_collections::id_alloc::Id;
let mut hive: Hive<&str> = Hive::new();
let a = hive.insert("a");
let b = hive.insert("b");
let mut score: PagedDirectMap<Id, u32> = PagedDirectMap::new();
score.insert(a, 10);
score.insert(b, 20);
// Removing frees the slot; its next occupant gets a new generation, so the
// stale id misses in the hive, and the new id misses the side-table entry
// left by the old one. Side tables are not cleaned up automatically.
hive.remove(a);
let c = hive.insert("c");
assert_eq!(c.index(), a.index());
assert_eq!(hive.get(a), None);
assert_eq!(score.get(c), None);
assert_eq!(score.remove(a), Some(10));
// A direct map iterates in slot order and answers range queries.
let in_range: Vec<u32> = score.range(a..=b).map(|(_, &s)| s).collect();
assert_eq!(in_range, [20]);
Python:
import numpy as np
from paged_collections import sparse_map
m = sparse_map("float64")
m.set_many(np.arange(0, 3_000_000, 1000), 1.0) # batch insert
m[7] = 2.5
m.get_many([7, 1000]) # array([2.5, 1. ])
values = m.values_view() # zero-copy, writeable
values *= 2 # updates the map in place
del values # resizing raises BufferError while a view is alive
Containers
| Rust | Python | Paging | Purpose |
|---|---|---|---|
PagedSparseSet<K> |
SparseSet |
index | Integer set: O(1) insert, remove, contains, clear; dense iteration |
PagedSparseMap<K, V> |
SparseMap, SparseMapF64, ... |
index | Sparse set with a dense value array |
PagedDirectMap<K, V> |
DirectMap, DirectMapF64, ... |
index | Values in place; key order and range queries |
PagedPriorityQueue<K, P> |
PriorityQueue, PriorityQueueF64 |
index | Indexed heap: priority changes and removal by key |
PagedVec<T> |
PagedList, PagedListF64, ... |
storage | Growable vector with stable addresses |
PagedDeque<T> |
PagedDeque |
storage | Double-ended queue with stable addresses |
Hive<T> |
Hive |
storage | Unordered slots with generational ids |
IdAllocator |
IdAllocator, IdMap |
none | Generational ids for use as keys |
The concurrent feature adds thread-safe variants: ConcurrentHive,
ConcurrentAppendHive, ConcurrentPagedVec, ConcurrentSparseSet/Map,
ConcurrentDirectMap, AtomicDirectMap, AtomicIdMap and
ConcurrentIdAllocator. Python binds the primitive-valued concurrent sets and
maps.
Documentation
- Paging model:
page sizes,
Flat/Radix/Treedirectories, memory behaviour. - Choosing a container: when each container fits, and when a standard one is better.
- Benchmarks: reference measurements and the commands to reproduce them.
- API: docs.rs (Rust),
_core.pyi(Python).
Layout
paged-collections/
├── crates/
│ ├── paged-collections/ # Rust library (no_std + alloc)
│ ├── paged-collections-python/ # PyO3 bindings for the _core extension
│ └── bench/ # Rust benchmarks outside the default build
├── python/
│ └── paged_collections/ # Python sources and type stubs
├── tests/ # Python tests
├── benchmarks/
│ └── python/ # Python benchmarks
└── docs/
└── site/ # mdBook documentation
Development commands are in CONTRIBUTING.md.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Metadata
Release files for paged-collections 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| paged_collections-0.1.0.tar.gz | 425.7 kB | Without provenance | Details for paged_collections-0.1.0.tar.gz |
Built distributions (wheels)
Total release size: 24.6 MB
Release files / paged_collections-0.1.0.tar.gz
| Download URL | paged_collections-0.1.0.tar.gz |
|---|---|
| Size | 425.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c6e232e92083e35cf1cd49a5e1bd28bf4a3fd6cd016a058cc01bb976519b169
|
|
BLAKE2b-256 checksum How to use checksums |
958105b1edf2e4021265c50d22d6ceb57781daf593cce1255548f90fa29f5544
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp315-abi3.abi3t-win_amd64.whl
| Download URL | paged_collections-0.1.0-cp315-abi3.abi3t-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.15 Windows x86-64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
35796ab57b1dc7f609f8c0051339f193f701de90346aa7132aa74e9227088fa6
|
|
BLAKE2b-256 checksum How to use checksums |
55a5e1ad2e3e58b0416d392108f2926e1e45f964583c01e2c44c94d189024d9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl
| Download URL | paged_collections-0.1.0-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.15 Linux glibc 2.28+ x86-64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
5a562512b07d7bc1ab7048cd1a00aaa6fcfc2e0f6a35d6d389c7fab73f4fdba1
|
|
BLAKE2b-256 checksum How to use checksums |
ac7753dd5fc63c82f3f2248d449d30b4eec54510ae95fe72e97e857b19c69f99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl
| Download URL | paged_collections-0.1.0-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.15 Linux glibc 2.28+ ARM64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
205c821d29f31997ef92d13c417256b5aaaeb83ae8d99a8e3f3d860009703e4d
|
|
BLAKE2b-256 checksum How to use checksums |
69dca2b0ad7473213fe30704822ad5fd26aeafbdda463839dc6d1dc65f0a40fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp315-abi3.abi3t-macosx_11_0_arm64.whl
| Download URL | paged_collections-0.1.0-cp315-abi3.abi3t-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.15 abi3 abi3t macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
bc89dc502af514814f08d788aeaedf10e8a01911e0da8afd461b46549c22909a
|
|
BLAKE2b-256 checksum How to use checksums |
a97e92056279b01102fe8a64576d5d47cf2bd738b7a20a2a05566c01400c1708
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp315-abi3.abi3t-macosx_10_12_x86_64.whl
| Download URL | paged_collections-0.1.0-cp315-abi3.abi3t-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.15 abi3 abi3t macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c9678c430a6b2484ec07c9965e937b6561a50b57f6755a62e52a0245460b56b1
|
|
BLAKE2b-256 checksum How to use checksums |
44d52a6cf93ca33c8b7bea0b4f70e3cffb3fda6b85a7f8a5bd41464d851f27c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp314-cp314t-win_amd64.whl
| Download URL | paged_collections-0.1.0-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f0a6d2f0b7ec3a473bb8f2a59769a5b4ef95f77555c64fe31fbed5a27d3c0b53
|
|
BLAKE2b-256 checksum How to use checksums |
fa3be57f76bb30cfca322f3854314f06ba73747dc178a160af7c5cffdfca5306
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl
| Download URL | paged_collections-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2aee3fd2911c385131fd89501f0e3a7bfcfe73fd963ea534adc00716eddb8384
|
|
BLAKE2b-256 checksum How to use checksums |
40126e4ea8f7515441647d297b56ba2b5a4d5d3b48856817d241b217824dd497
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl
| Download URL | paged_collections-0.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
4a9017f8d4cab4ec68c111a6becdc68e56935f57b506fba02196b6fc5147e0ab
|
|
BLAKE2b-256 checksum How to use checksums |
977bdc60f1bfd151741152d26ccdbca764baee117a7758d5115a8dd8d0a96526
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl
| Download URL | paged_collections-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8e2c083e75fc2b5c1f8b201998210dff41d2dd484403c8a64b121ae898731a85
|
|
BLAKE2b-256 checksum How to use checksums |
21359b36428be80df4dfe757a25d8a612c90929997d53911252e5f34048707e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp314-cp314t-macosx_10_12_x86_64.whl
| Download URL | paged_collections-0.1.0-cp314-cp314t-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
dad781d3df9dad565191d900c494904faa3c276e7c0a9f7c452992a36152b239
|
|
BLAKE2b-256 checksum How to use checksums |
3b086e165c8a87665bd1b6dd55e4273672183e6285f32afc84682cb390318261
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp310-cp310-win_amd64.whl
| Download URL | paged_collections-0.1.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f2c95e483ef490853bf6e64e2cf2aa05a71ed12a10fde29d0f618e9440ecc04e
|
|
BLAKE2b-256 checksum How to use checksums |
54df596fb8cb349b2bab9211fb640257f3c5afc0e4a44e02b8ad146b6f337aeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | paged_collections-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
2b03865b8ab5c0e44809e2461b5b546f5970a016a4774ac76043daea41ee4fb2
|
|
BLAKE2b-256 checksum How to use checksums |
4ef1cab1cbc4318ff4bc00ddcd11b42105abac9cd578b949e14e3e4e660d9eaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp310-cp310-manylinux_2_28_aarch64.whl
| Download URL | paged_collections-0.1.0-cp310-cp310-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
8c640ce969e297caa2b76d533a68281eeb7ce22d7650e94353eb6e31169b395d
|
|
BLAKE2b-256 checksum How to use checksums |
41522b57a45423f603d4c733ecba73064ef8ea270d27348eff0df2dc62b5cf36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | paged_collections-0.1.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
de949e3653f65ed9ce44d29c23d63b83337eb0e3e24aea261c1777e78d76a3f1
|
|
BLAKE2b-256 checksum How to use checksums |
4ad3581d1a04c9b16e004801bb9b80726d9df7dca301eecd8fe2dfce39f8ad62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / paged_collections-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl
| Download URL | paged_collections-0.1.0-cp310-cp310-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
d1a7288b53c0dab8f3c60e1521c1a99d4c54eca4b6fc73a66a06b49317471ab7
|
|
BLAKE2b-256 checksum How to use checksums |
c7096283fd073fb0160b60eb0f6fcf54113d453da74a3bb80d46831a42737fd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for paged-collections 0.1.0
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.