This release is a pre-release and may not be stable for production use.
Immutable
Overview
This library provides decorators and base classes to create immutable data classes in Python. By enforcing immutability and keyword-only arguments, it enhances the robustness and clarity of your data structures.
📋 Requirements
- Python 3.9 or later.
- No external dependencies are required.
📦 Installation
Pip
pip install python-immutable
uv
uv add python-immutable
Poetry
poetry add python-immutable
🛠 Usage
Using immutable Decorator
Apply immutable to a class to make it immutable and enforce keyword-only arguments.
from immutable import immutable
@immutable
class MyClass:
# Fields here
Extending Immutable Base Class
Inherit from Immutable for similar functionality.
from immutable import Immutable
class MyClass(Immutable):
# Fields here
🤝 Contributing
Contributions are welcome. Please submit pull requests or issues on the GitHub repository.
⚠️ Important Note
Ensure compatibility with Python 3.9 or newer when contributing.
🔒 License
This project is released under the Apache-2.0 License. See the LICENSE file for more details.
Metadata
Release files for python-immutable 1.2.1.dev225060610357995351
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 |
|---|---|---|---|---|
| python_immutable-1.2.1.dev225060610357995351.tar.gz | 7.7 kB | With provenance | Details for python_immutable-1.2.1.dev225060610357995351.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_immutable-1.2.1.dev225060610357995351-py3-none-any.whl | Python 3 | none | any | Details for python_immutable-1.2.1.dev225060610357995351-py3-none-any.whl |
Total release size: 15.7 kB
Release files / python_immutable-1.2.1.dev225060610357995351.tar.gz
| Download URL | python_immutable-1.2.1.dev225060610357995351.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
157fe9189b6fe703614f30581283702bee8a92c3a9c657409df90ee3b4e1ada8
|
|
BLAKE2b-256 checksum How to use checksums |
cd338969e75398b9aaa504661ad12ee6afe130db51167b0955e9f7c5d8173a23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2025.
Transparency logRelease files / python_immutable-1.2.1.dev225060610357995351-py3-none-any.whl
| Download URL | python_immutable-1.2.1.dev225060610357995351-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
638b386ee31eb240a882e098124f736fd4038389e67fcb7ec1cdc17ef9708ca4
|
|
BLAKE2b-256 checksum How to use checksums |
36be76c4e2a3872d8bb837eef2716b0f4da0935b0b996734e2ec383dacc63eb6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2025.
Transparency logSecurity for python-immutable 1.2.1.dev225060610357995351
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for python_immutable-1.2.1.dev225060610357995351.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2025.
Transparency logA 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.