rpds-py
Python bindings to Rust's persistent data structures (rpds)
Decision gist · record as of 2026-08-14
Yes, if you need persistent data structures and are on Python 3.11+. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and offers pre-built wheels for most platforms. Install friction is moderate but manageable; most users will get binary wheels. The API is minimal but functional for core use cases like replacing pyrsistent.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later.
- If installing from source, a Rust toolchain must be available at build time.
- Medium install friction due to Rust build-time dependency when installing from source.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
last release 2026-06-30 (45 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 613,601,443 downloads/mo, #54 on PyPI
Alternatives
Verify before relying
pip install rpds-py
from rpds import HashTrieMap, HashTrieSet, List
m = HashTrieMap({"foo": "bar"})
m_updated = m.insert("baz", "quux")
s = HashTrieSet({"a", "b"})
s_updated = s.insert("c")
L = List([1, 2, 3])
L_updated = L.push_front(0)- Whether all common platforms have pre-built wheels or if source compilation is still common for some environments.
- Performance characteristics compared to pyrsistent or standard Python collections in typical use cases.
- Completeness of the API surface relative to the full Rust rpds crate.
What it is and what it does
rpds-py wraps the Rust rpds crate to expose persistent (immutable) data structures in Python. It provides HashTrieMap (immutable dict), HashTrieSet (immutable set), and List (immutable linked list) that use structural sharing to minimize memory overhead when modified. Each operation returns a new instance rather than mutating in place, making these structures safe for concurrent use and functional programming patterns.
The package was initially created to replace pyrsistent in the referencing library. Methods follow Rust rpds naming conventions rather than pyrsistent's, so it is not a drop-in replacement but offers similar semantics. It has no runtime dependencies and supports Python 3.11 through 3.15, with wheels available for most common platforms.
Use it for
- Building immutable data structures for functional programming or concurrent code where mutation safety is critical.
- Replacing pyrsistent in projects like JSON schema validators that need efficient persistent collections.
- Implementing undo/redo systems or version control by storing immutable snapshots of application state.
- Creating thread-safe data structures without locks by relying on immutability guarantees.
- Optimizing memory usage in applications that frequently create modified copies of collections.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need persistent data structures and are on Python 3.11+.
The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and offers pre-built wheels for most platforms. Install friction is moderate but manageable; most users will get binary wheels. The API is minimal but functional for core use cases like replacing pyrsistent.
Install
rpds-py on PyPI
Before you install
Medium install friction due to Rust build-time dependency when installing from source. Pre-built wheels are available for common platforms (x86_64, ARM, RISC-V across Linux, macOS, Windows), so most users should get binary installation. Active maintenance with recent releases.
Requires Python 3.11 or later. If installing from source, a Rust toolchain must be available at build time.
License in practice
MIT license permits commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install rpds-py
from rpds import HashTrieMap, HashTrieSet, List
m = HashTrieMap({"foo": "bar"})
m_updated = m.insert("baz", "quux")
s = HashTrieSet({"a", "b"})
s_updated = s.insert("c")
L = List([1, 2, 3])
L_updated = L.push_front(0)
Verify before relying
- Whether all common platforms have pre-built wheels or if source compilation is still common for some environments.
- Performance characteristics compared to pyrsistent or standard Python collections in typical use cases.
- Completeness of the API surface relative to the full Rust rpds crate.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 45 days since the last release |
| First released | |
| Downloads | 613,601,443 / month, #54 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyProgramming Language :: Rust |
Evidence: rpds_py-2026.6.3-cp311-cp311-macosx_10_12_x86_64.whl; rpds_py-2026.6.3-cp311-cp311-macosx_11_0_arm64.whl; rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl; rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; rpds_py-2026.6.3-cp311-cp311-manylinux_2_31_riscv64.whl; rpds_py-2026.6.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl; rpds_py-2026.6.3-cp311-cp311-musllinux_1_2_aarch64.whl; rpds_py-2026.6.3-cp311-cp311-musllinux_1_2_i686.whl; rpds_py-2026.6.3-cp311-cp311-musllinux_1_2_x86_64.whl; rpds_py-2026.6.3-cp311-cp311-win32.whl; rpds_py-2026.6.3-cp311-cp311-win_amd64.whl; rpds_py-2026.6.3-cp311-cp311-win_arm64.whl; rpds_py-2026.6.3-cp312-cp312-macosx_10_12_x86_64.whl; rpds_py-2026.6.3-cp312-cp312-macosx_11_0_arm64.whl; rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “persistent data structures python”
- rpds-pyProvides Python bindings to Rust's persistent data structures (rpds…
- BTreesBTrees provides persistent, scalable B-tree data structures optimized…
- pyrsistentPyrsistent provides immutable, persistent data structures (vectors,…
Give your agent the search over MCP, or paste the wish link into any chat.
Similar packages
Pyrsistent provides immutable, persistent data structures (vectors, maps, sets, records, and others) where all mutations return new copies, leaving originals unchanged.
However, the last release was over 1000 days ago; verify that the package still meets your Python version and feature needs before committing to it for new projects.
Provides an immutable mapping type backed by a Hash Array Mapped Trie (HAMT) data structure, offering O(log N) performance for get and set operations with hashable, comparable, and pickleable Map objects.
Provides immutable container types (Dict and List) for Python that prevent modification after creation and automatically coerce nested structures to immutable equivalents.
Python bindings for the BLAKE3 cryptographic hash function, exposing the official Rust implementation with support for keyed hashing, key derivation, extendable output, and multithreaded hashing.
Install it if you need modern hashing with keyed or key-derivation modes; the medium install friction is acceptable for most environments since binary wheels are…
Provides an immutable dictionary class that wraps Python's built-in dict, preventing in-place modifications while remaining hashable and comparable to regular dicts.
Provides a list-like container that starts mutable but can be frozen to prevent further modifications, and becomes hashable once frozen.
Install it if you need a hashable list-like container or want to enforce immutability after initialization.
See also ignore-python · py-ed25519-zebra-bindings · regress · smoldot-light