itypes
Simple immutable types for python.
What it is and what it does
itypes provides immutable versions of Python's dict and list that prevent accidental modification and automatically convert nested mutable structures to immutable equivalents. When you call methods like `set()` or `delete()`, they return new copies rather than modifying in place; direct assignment or deletion raises a TypeError. The package also supports nested lookups and updates via `get_in()`, `set_in()`, and `delete_in()` methods, and objects are hashable so they can be used as dictionary keys or in sets.
The library is designed for simplicity and code clarity rather than performance—it trades speed for readability in scenarios where immutability helps prevent bugs or makes intent clearer. You can subclass `itypes.Dict` or `itypes.Object` to create custom immutable types with restricted interfaces, using private attributes and `@property` decorators for controlled access.
Use it for:
- Store configuration data that should not be accidentally modified during program execution
- Use immutable dicts as dictionary keys or in sets where hashability is required
- Create custom immutable domain objects by subclassing itypes.Object with property-based access
- Enforce immutability in nested data structures where both top-level and inner collections must be read-only
- Simplify reasoning about data flow in codebases where immutability prevents side effects
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides immutable container types (Dict and List) for Python that prevent modification after creation and automatically coerce nested structures to immutable equivalents.
No. The package is abandoned (last commit 2020-04-19, repository archived) with no active maintenance or security updates. While it has low install friction and permissive licensing, the lack of maintenance means it will not receive bug fixes or compatibility updates for modern Python versions. For immutable containers, consider actively maintained alternatives.
Install
itypes on PyPI
pip
pip install itypesuv
uv add itypespoetry
poetry add itypesInstalling itypes
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last updated in April 2020, over 2308 days ago, with the repository archived. No active maintenance or security updates are being provided.
License in practice
Licensed under BSD (permissive), which allows use in most projects without restriction. No notable licensing constraints for adoption.
Quickstart
pip install itypes
import itypes
d = itypes.Dict({'a': 1, 'b': 2})
l = itypes.List(['x', 'y', 'z'])
d2 = d.set('c', 3) # returns new Dict, original unchanged
Verify before relying
- Whether the package works reliably on Python versions released after 2020
- Whether nested immutability coercion handles all edge cases in modern Python
- Performance characteristics compared to alternatives for large data structures
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,308 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 1,659,324/month — #3,676 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: itypes-1.2.0-py2.py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
constantdictProvides an immutable dictionary class that…
permissive · top 15,000 on PyPI
ml-collectionsProvides dict-like configuration data…
permissive · top 5,000 on PyPI
optionaldictA dict subclass that automatically omits None…
permissive · top 15,000 on PyPI
pyrsistentPyrsistent provides immutable, persistent data…
permissive · top 1,000 on PyPI
frozendictProvides an immutable, hashable dictionary…
copyleft · top 5,000 on PyPI
immutabledictProvides an immutable dictionary wrapper that…
permissive · top 1,000 on PyPI
rpds-pyProvides Python bindings to Rust's persistent…
permissive · top 100 on PyPI
immutablesProvides an immutable mapping type backed by a…
permissive · top 5,000 on PyPI
lensesLenses provides a functional approach to…
copyleft · top 15,000 on PyPI
sumtypesProvides algebraic data types for Python,…
permissive · top 15,000 on PyPI