{"id":26246265,"url":"https://github.com/emcd/python-frigid","last_synced_at":"2025-04-23T20:27:11.403Z","repository":{"id":266572335,"uuid":"898722708","full_name":"emcd/python-frigid","owner":"emcd","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-11T00:15:34.000Z","size":212,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T01:24:25.403Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emcd.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-04T23:03:39.000Z","updated_at":"2025-04-11T00:15:38.000Z","dependencies_parsed_at":"2025-01-23T01:20:21.508Z","dependency_job_id":"ed8bb505-3c9d-4148-afe4-4eb999fec330","html_url":"https://github.com/emcd/python-frigid","commit_stats":null,"previous_names":["emcd/python-frigid"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emcd%2Fpython-frigid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emcd%2Fpython-frigid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emcd%2Fpython-frigid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emcd%2Fpython-frigid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emcd","download_url":"https://codeload.github.com/emcd/python-frigid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250508176,"owners_count":21442170,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-13T13:17:44.788Z","updated_at":"2025-04-23T20:27:11.395Z","avatar_url":"https://github.com/emcd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. vim: set fileencoding=utf-8:\n.. -*- coding: utf-8 -*-\n.. +--------------------------------------------------------------------------+\n   |                                                                          |\n   | Licensed under the Apache License, Version 2.0 (the \"License\");          |\n   | you may not use this file except in compliance with the License.         |\n   | You may obtain a copy of the License at                                  |\n   |                                                                          |\n   |     http://www.apache.org/licenses/LICENSE-2.0                           |\n   |                                                                          |\n   | Unless required by applicable law or agreed to in writing, software      |\n   | distributed under the License is distributed on an \"AS IS\" BASIS,        |\n   | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |\n   | See the License for the specific language governing permissions and      |\n   | limitations under the License.                                           |\n   |                                                                          |\n   +--------------------------------------------------------------------------+\n\n\n*******************************************************************************\n                                     frigid\n*******************************************************************************\n\n.. image:: https://img.shields.io/pypi/v/frigid\n   :alt: Package Version\n   :target: https://pypi.org/project/frigid/\n\n.. image:: https://img.shields.io/pypi/status/frigid\n   :alt: PyPI - Status\n   :target: https://pypi.org/project/frigid/\n\n.. image:: https://github.com/emcd/python-frigid/actions/workflows/tester.yaml/badge.svg?branch=master\u0026event=push\n   :alt: Tests Status\n   :target: https://github.com/emcd/python-frigid/actions/workflows/tester.yaml\n\n.. image:: https://emcd.github.io/python-frigid/coverage.svg\n   :alt: Code Coverage Percentage\n   :target: https://github.com/emcd/python-frigid/actions/workflows/tester.yaml\n\n.. image:: https://img.shields.io/github/license/emcd/python-frigid\n   :alt: Project License\n   :target: https://github.com/emcd/python-frigid/blob/master/LICENSE.txt\n\n.. image:: https://img.shields.io/pypi/pyversions/frigid\n   :alt: Python Versions\n   :target: https://pypi.org/project/frigid/\n\n\n🔒 A Python library package which provides **immutable data structures** -\ncollections which cannot be modified after creation.\n\n\nKey Features ⭐\n===============================================================================\n\n* 📖 **Immutable Dictionary**: Like a regular `dict\n  \u003chttps://docs.python.org/3/library/stdtypes.html#dict\u003e`_, but entries cannot\n  be modified or removed. Also has variant for validation on initialization.\n  And provides set operations not found on `MappingProxyType\n  \u003chttps://docs.python.org/3/library/types.html#types.MappingProxyType\u003e`_.\n* 🗃️ **Immutable Namespace**: Similar to `SimpleNamespace\n  \u003chttps://docs.python.org/3/library/types.html#types.SimpleNamespace\u003e`_, but\n  attributes are immutable from creation.\n* 🧱 **Additional Types**: Classes (including abstract base classes), modules,\n  and objects with immutable behavior.\n* 🏗️ **Flexible Initialization**: Support for unprotected attributes during\n  initialization; useful for compatibility with class decorators, such as\n  `dataclasses\n  \u003chttps://docs.python.org/3/library/dataclasses.html#dataclasses.dataclass\u003e`_.\n* 🔓 **Flexible Mutability**: Support for declaring specific attributes as\n  mutable, enabling selective modification while maintaining immutability for\n  other attributes.\n\n\nInstallation 📦\n===============================================================================\n\n::\n\n    pip install frigid\n\n\nNote on Immutability 📢\n===============================================================================\n\n   Enforcement of immutability is quite difficult in Python. While this library\n   enforces immutability by default, it can be circumvented by anyone who has\n   intermediate knowledge of Python machinery and who is determined to\n   circumvent the immutability. Use the library in the spirit of making\n   programs safer, but understand that it cannot truly prevent unwanted state\n   tampering.\n\n\nExamples 💡\n===============================================================================\n\n\nImmutable Namespaces 🗃️\n-------------------------------------------------------------------------------\n\nAn immutable namespace, similar to ``types.SimpleNamespace``, is available.\nThis namespace can be initialized from multiple iterables and from keyword\narguments. (Keyword arguments shown below; see documentation for additional\nforms of initialization.)\n\n\u003e\u003e\u003e from frigid import Namespace\n\u003e\u003e\u003e ns = Namespace( apples = 12, bananas = 6 )\n\u003e\u003e\u003e ns.cherries = 42    # ❌ Attempted assignment raises error.\nTraceback (most recent call last):\n...\nfrigid.exceptions.AttributeImmutabilityError: Cannot assign attribute 'cherries'.\n\u003e\u003e\u003e del ns.apples       # ❌ Attempted deletion raises error.\nTraceback (most recent call last):\n...\nfrigid.exceptions.AttributeImmutabilityError: Cannot delete attribute 'apples'.\n\u003e\u003e\u003e ns\nfrigid.namespaces.Namespace( apples = 12, bananas = 6 )\n\n\nImmutable Dictionaries 📖\n-------------------------------------------------------------------------------\n\nAn immutable dictionary, similar to ``dict``, is available. This dictionary can\nbe initialized from multiple iterables and from keyword arguments. (Keyword\narguments shown below; see documentation for additional forms of\ninitialization.)\n\n\u003e\u003e\u003e from frigid import Dictionary\n\u003e\u003e\u003e dct = Dictionary( apples = 12, bananas = 6)\n\u003e\u003e\u003e dct['cherries'] = 42  # ❌ Attempted assignment raises error.\nTraceback (most recent call last):\n...\nfrigid.exceptions.EntryImmutabilityError: Cannot assign entry for 'cherries'.\n\u003e\u003e\u003e del dct['bananas']    # ❌ Attempted removal raises error.\nTraceback (most recent call last):\n...\nfrigid.exceptions.EntryImmutabilityError: Cannot delete entry for 'bananas'.\n\u003e\u003e\u003e dct\nfrigid.dictionaries.Dictionary( {'apples': 12, 'bananas': 6} )\n\n\nImmutable Objects 🧱\n-------------------------------------------------------------------------------\n\nThe ``immutable`` decorator can be applied to any class to make its instances fully immutable after initialization.\n\n\u003e\u003e\u003e from frigid import immutable\n\u003e\u003e\u003e @immutable\n... class Config:\n...     def __init__( self, debug = False ):\n...         self.debug = debug\n...\n\u003e\u003e\u003e config = Config( debug = True )\n\u003e\u003e\u003e config.verbose = True  # ❌ Attempted addition raises error\nTraceback (most recent call last):\n...\nfrigid.exceptions.AttributeImmutabilityError: Cannot assign or delete attribute 'verbose'.\n\u003e\u003e\u003e config.debug = False   # ❌ Attempted reassignment raises error\nTraceback (most recent call last):\n...\nfrigid.exceptions.AttributeImmutabilityError: Cannot assign or delete attribute 'debug'.\n\n\nUse Cases 🎯\n===============================================================================\n\n* 🔒 **Configuration Objects**: Objects which must maintain consistent state\n  throughout program execution.\n* 📊 **Value Objects**: Objects which represent values and should be immutable,\n  like numbers or strings.\n* 🧱 **Immutable Collections**: Many scenarios requiring collections with\n  complete immutability guarantees.\n\n\n`More Flair \u003chttps://www.imdb.com/title/tt0151804/characters/nm0431918\u003e`_\n===============================================================================\n\n.. image:: https://img.shields.io/github/last-commit/emcd/python-frigid\n   :alt: GitHub last commit\n   :target: https://github.com/emcd/python-frigid\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json\n   :alt: Copier\n   :target: https://github.com/copier-org/copier\n\n.. image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg\n   :alt: Hatch\n   :target: https://github.com/pypa/hatch\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\n   :alt: pre-commit\n   :target: https://github.com/pre-commit/pre-commit\n\n.. image:: https://microsoft.github.io/pyright/img/pyright_badge.svg\n   :alt: Pyright\n   :target: https://microsoft.github.io/pyright\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n   :alt: Ruff\n   :target: https://github.com/astral-sh/ruff\n\n.. image:: https://img.shields.io/pypi/implementation/frigid\n   :alt: PyPI - Implementation\n   :target: https://pypi.org/project/frigid/\n\n.. image:: https://img.shields.io/pypi/wheel/frigid\n   :alt: PyPI - Wheel\n   :target: https://pypi.org/project/frigid/\n\n\nOther Projects by This Author 🌟\n===============================================================================\n\n\n* `python-absence \u003chttps://github.com/emcd/python-absence\u003e`_\n    - PyPI: `absence \u003chttps://pypi.org/project/absence/\u003e`_\n\n    🕳️ A Python library package which provides a **sentinel for absent values** - a falsey, immutable singleton that represents the absence of a value in contexts where ``None`` or ``False`` may be valid values.\n* `python-accretive \u003chttps://github.com/emcd/python-accretive\u003e`_\n    - PyPI: `accretive \u003chttps://pypi.org/project/accretive/\u003e`_\n\n    🌌 A Python library package which provides **accretive data structures** - collections which can grow but never shrink.\n* `python-falsifier \u003chttps://github.com/emcd/python-falsifier\u003e`_\n    - PyPI: `falsifier \u003chttps://pypi.org/project/falsifier/\u003e`_\n\n    🎭 A very simple Python library package which provides a **base class for falsey objects** - objects that evaluate to ``False`` in boolean contexts.\n* `python-icecream-truck \u003chttps://github.com/emcd/python-icecream-truck\u003e`_\n    - PyPI: `icecream-truck \u003chttps://pypi.org/project/icecream-truck/\u003e`_\n\n    🍦 **Flavorful Debugging** - A Python library which enhances the powerful and well-known ``icecream`` package with flavored traces, configuration hierarchies, customized outputs, ready-made recipes, and more.\n* `python-mimeogram \u003chttps://github.com/emcd/python-mimeogram\u003e`_\n    - PyPI: `mimeogram \u003chttps://pypi.org/project/mimeogram/\u003e`_\n\n    📨 A command-line tool for **exchanging collections of files with Large Language Models** - bundle multiple files into a single clipboard-ready document while preserving directory structure and metadata... good for code reviews, project sharing, and LLM interactions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femcd%2Fpython-frigid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femcd%2Fpython-frigid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femcd%2Fpython-frigid/lists"}