Skip to main content
Pre-release

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.dev325060610399975197

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-immutable 1.2.1.dev325060610399975197
File Size Uploaded
python_immutable-1.2.1.dev325060610399975197.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-immutable 1.2.1.dev325060610399975197
File Interpreter ABI Platform
python_immutable-1.2.1.dev325060610399975197-py3-none-any.whl Python 3 none any Details

Total release size: 15.7 kB

Release files / python_immutable-1.2.1.dev325060610399975197.tar.gz

Download URL python_immutable-1.2.1.dev325060610399975197.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
eeeb7550db13a72f0d8514a9d9bd0ca3b69b40deb71a617a9970af27f67d5501
BLAKE2b-256 checksum
How to use checksums
a89a110884610ceac9e60be49dc54ba6dc3d7e65cb8647102e07c74b1efe1f27
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 log

Release files / python_immutable-1.2.1.dev325060610399975197-py3-none-any.whl

Download URL python_immutable-1.2.1.dev325060610399975197-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
903ff99817ad3741f6d24ed1303915700759a3d1b923eb31b7f64eb77dc9ce2b
BLAKE2b-256 checksum
How to use checksums
2b3c28b336d29e34d6f76fb92fdd800523fbd6be9ba6774a53ebe5ebe8ebf0b3
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 log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page