rpds-py

raw JSON →
0.30.0 verified Tue May 12 auth: no python install: verified quickstart: stale

rpds-py provides Python bindings to Rust's persistent data structures (rpds), offering immutable collections with efficient structural sharing. The current version is 0.30.0, released on March 28, 2026. The library has a regular release cadence, with multiple updates per year.

pip install rpds-py
error ModuleNotFoundError: No module named 'rpds'
cause The `rpds-py` package has not been installed in the current Python environment.
fix
pip install rpds-py
error ModuleNotFoundError: No module named 'rpds_py'
cause The `rpds-py` package exposes its functionality through the `rpds` module, not `rpds_py`.
fix
import rpds
error AttributeError: 'List' object has no attribute 'sort'
cause `rpds.List` objects are immutable and do not have an in-place `sort()` method; instead, they provide a `sorted()` method that returns a new sorted list.
fix
new_list = my_list.sorted()
error TypeError: 'PMap' object does not support item assignment
cause `rpds.PMap` is an immutable collection and does not support direct item assignment like mutable Python dictionaries; instead, use methods like `insert()` or `set()` which return a new PMap.
fix
new_pmap = my_pmap.insert('key', 'value')
breaking rpds-py requires Python 3.10 or higher.
fix Ensure your Python environment is version 3.10 or higher.
gotcha rpds-py collections are immutable; modifying them returns a new instance.
fix Assign the result of any modification to a new variable or overwrite the existing one.
breaking `rpds.HashTrieMap` uses `.insert(key, value)` to add or update elements, not `.set(key, value)`. Attempting to use a non-existent method like `set()` will result in an AttributeError.
fix Replace `.set(key, value)` with `.insert(key, value)`. Remember that `rpds` collections are immutable, so you must assign the result of `insert()` back to a variable (e.g., `map = map.insert('key', 'value')`).
python os / libc status wheel install import disk
3.10 alpine (musl) - - 0.00s 19.2M
3.10 slim (glibc) - - 0.00s 19M
3.11 alpine (musl) - - 0.00s 21.0M
3.11 slim (glibc) - - 0.00s 21M
3.12 alpine (musl) - - 0.00s 12.9M
3.12 slim (glibc) - - 0.00s 13M
3.13 alpine (musl) - - 0.00s 12.5M
3.13 slim (glibc) - - 0.00s 13M
3.9 alpine (musl) - - 0.00s 18.7M
3.9 slim (glibc) - - 0.00s 19M

Demonstrates creating a HashTrieMap, inserting a key-value pair, and retrieving a value.

from rpds import HashTrieMap

# Create an empty HashTrieMap
map = HashTrieMap()

# Insert a key-value pair
map = map.set('key', 'value')

# Retrieve a value
value = map.get('key')
print(value)  # Output: 'value'