{"id":307,"library":"rpds-py","title":"rpds-py","description":"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.","status":"active","version":"0.30.0","language":"python","source_language":"en","source_url":"https://github.com/crate-py/rpds","tags":["persistent data structures","immutable collections","Rust bindings","Python 3.10+"],"install":[{"cmd":"pip install rpds-py","lang":"bash","label":"Install rpds-py"}],"dependencies":[{"reason":"Required for Rust-Python interoperability","package":"PyO3","optional":false}],"imports":[{"note":"HashMap is not available; use HashTrieMap instead.","wrong":"from rpds import HashMap","symbol":"HashTrieMap","correct":"from rpds import HashTrieMap"},{"note":"HashSet is not available; use HashTrieSet instead.","wrong":"from rpds import HashSet","symbol":"HashTrieSet","correct":"from rpds import HashTrieSet"}],"quickstart":{"code":"from rpds import HashTrieMap\n\n# Create an empty HashTrieMap\nmap = HashTrieMap()\n\n# Insert a key-value pair\nmap = map.set('key', 'value')\n\n# Retrieve a value\nvalue = map.get('key')\nprint(value)  # Output: 'value'","lang":"python","description":"Demonstrates creating a HashTrieMap, inserting a key-value pair, and retrieving a value."},"warnings":[{"fix":"Ensure your Python environment is version 3.10 or higher.","message":"rpds-py requires Python 3.10 or higher.","severity":"breaking","affected_versions":"0.30.0 and later"},{"fix":"Assign the result of any modification to a new variable or overwrite the existing one.","message":"rpds-py collections are immutable; modifying them returns a new instance.","severity":"gotcha","affected_versions":"All versions"},{"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')`).","message":"`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.","severity":"breaking","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-05-12T12:58:50.965Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"pip install rpds-py","cause":"The `rpds-py` package has not been installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'rpds'"},{"fix":"import rpds","cause":"The `rpds-py` package exposes its functionality through the `rpds` module, not `rpds_py`.","error":"ModuleNotFoundError: No module named 'rpds_py'"},{"fix":"new_list = my_list.sorted()","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.","error":"AttributeError: 'List' object has no attribute 'sort'"},{"fix":"new_pmap = my_pmap.insert('key', 'value')","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.","error":"TypeError: 'PMap' object does not support item assignment"}],"ecosystem":"pypi","meta_description":null,"install_score":80,"install_tag":"verified","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"19.2M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"19M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"21.0M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"21M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"12.9M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"13M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"12.5M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"13M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"18.7M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"19M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}