{"id":17623737,"url":"https://github.com/wiseaidev/frozndict","last_synced_at":"2025-07-14T13:10:06.987Z","repository":{"id":57432351,"uuid":"471509527","full_name":"wiseaidev/frozndict","owner":"wiseaidev","description":"frozndict is a memory efficient immutable dictionary.","archived":false,"fork":false,"pushed_at":"2022-03-22T15:25:18.000Z","size":350,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T12:49:25.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.org/project/frozndict/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiseaidev.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-18T20:34:44.000Z","updated_at":"2023-01-03T12:49:30.000Z","dependencies_parsed_at":"2022-09-19T07:00:18.947Z","dependency_job_id":null,"html_url":"https://github.com/wiseaidev/frozndict","commit_stats":null,"previous_names":["harmouch101/frozndict"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/wiseaidev/frozndict","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiseaidev%2Ffrozndict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiseaidev%2Ffrozndict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiseaidev%2Ffrozndict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiseaidev%2Ffrozndict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiseaidev","download_url":"https://codeload.github.com/wiseaidev/frozndict/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiseaidev%2Ffrozndict/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265297048,"owners_count":23742585,"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":"2024-10-22T21:42:38.830Z","updated_at":"2025-07-14T13:10:06.947Z","avatar_url":"https://github.com/wiseaidev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=========\nfrozndict\n=========\n\n.. image:: https://img.shields.io/badge/License-GPLv3-blue.svg\n   :target: https://github.com/Harmouch101/frozndict/blob/main/LICENSE\n   :alt: License\n\n.. image:: https://img.shields.io/pypi/v/frozndict.svg\n   :target: https://pypi.org/project/frozndict/\n   :alt: pypi version\n\n.. image:: https://img.shields.io/github/repo-size/Harmouch101/frozndict\n   :target: https://github.com/Harmouch101/frozndict/\n   :alt: Repo Size\n\n.. image:: https://circleci.com/gh/Harmouch101/frozndict/tree/main.svg?style=svg\n   :target: https://circleci.com/gh/Harmouch101/frozndict/tree/main\n   :alt: Circle ci Build Status\n\n.. image:: https://raw.githubusercontent.com/harmouch101/frozndict/main/assets/pydoc.png\n   :target: https://github.com/Harmouch101/frozndict/\n   :alt: Banner\n\n\n**frozndict** is a python package that acts as an alternative to frozenset, but for dictionaries.\n\n\n🛠️ Requirements\n---------------\n\n**frozndict** requires Python 3.9 or above.\n\nTo install Python 3.9, I recommend using `pyenv`_.\n\n.. code-block:: bash\n\n   # install pyenv\n   git clone https://github.com/pyenv/pyenv ~/.pyenv\n\n   # setup pyenv (you should also put these three lines in .bashrc or similar)\n   # if you are using zsh\n   cat \u003c\u003c EOF \u003e\u003e ~/.zshrc\n   # pyenv config\n   export PATH=\"${HOME}/.pyenv/bin:${PATH}\"\n   export PYENV_ROOT=\"${HOME}/.pyenv\"\n   eval \"$(pyenv init -)\"\n   EOF\n\n   # or if you using the default bash shell, do this instead:\n   cat \u003c\u003c EOF \u003e\u003e ~/.bashrc\n   # pyenv config\n   export PATH=\"${HOME}/.pyenv/bin:${PATH}\"\n   export PYENV_ROOT=\"${HOME}/.pyenv\"\n   eval \"$(pyenv init -)\"\n   EOF\n   # Close and open a new shell session\n   # install Python 3.9.10\n   pyenv install 3.9.10\n\n   # make it available globally\n   pyenv global system 3.9.10\n\n\nTo manage the Python 3.9 virtualenv, I recommend using `poetry`_.\n\n.. code-block:: bash\n\n   # install poetry\n   curl -sSL https://install.python-poetry.org | python3 -\n   poetry --version\n   Poetry version 1.1.13\n\n   # Having the python executable in your PATH, you can use it:\n   poetry env use 3.9.10\n\n   # However, you are most likely to get the following issue:\n   Creating virtualenv frozndict-dxc671ba-py3.9 in ~/.cache/pypoetry/virtualenvs\n\n   ModuleNotFoundError\n\n   No module named 'virtualenv.seed.via_app_data'\n\n   at \u003cfrozen importlib._bootstrap\u003e:973 in _find_and_load_unlocked\n\n   # To resolve it, you need to reinstall virtualenv through pip\n   sudo apt remove --purge python3-virtualenv virtualenv\n   python3 -m pip install -U virtualenv\n\n   # Now, you can just use the minor Python version in this case:\n   poetry env use 3.9.10\n   Using virtualenv: ~/.cache/pypoetry/virtualenvs/frozndict-dxc671ba-py3.9\n\n\n🚨 Installation\n---------------\n\nWith :code:`pip`:\n\n.. code-block:: console\n\n   python3.9 -m pip install frozndict\n\nWith `pipx`_:\n\n.. code-block:: console\n\n   python3.9 -m pip install --user pipx\n   pipx install --python python3.9 frozndict\n\n🚸 Usage\n--------\n\n.. code-block:: python3\n\n   \u003e\u003e\u003e from frozndict import frozendict\n\n   # Empty immutable immutable dictionary.\n   \u003e\u003e\u003e frozen_dict = frozendict({})\n   frozendict({})\n\n   # Non empty immutable immutable dictionary.\n   \u003e\u003e\u003e frozen_dict = frozendict({\"Greetings\": \"Hello World!\"})\n   \u003e\u003e\u003e frozen_dict\n   frozendict({'Greetings': 'Hello World!'})\n\n   # Get an item.\n   \u003e\u003e\u003e frozen_dict[\"Greetings\"]\n   'Hello World!'\n\n   # Copy a dictionary.\n   \u003e\u003e\u003e frozen_dict_copy = frozen_dict.copy()\n   \u003e\u003e\u003e frozen_dict_copy\n   {'Greetings': 'Hello World!'}\n\n   # Nested dictionary.\n   \u003e\u003e\u003e frozen_dict_copy = frozendict({'x': 3, 'y': 4, 'z': {'a': 0, 'b': [3,1,{4,1},[5,9]]}}, c= 1)\n   \u003e\u003e\u003e print(a.pretty_repr())\n   frozendict({\n       x: 3,\n       y: 4,\n       z: {\n           a: 0,\n           b: [3, 1, {1, 4}, [5, 9]],\n       },\n       c: 1,\n   })\n\n   # Create an immutable dictionary using `fromkeys` method.\n   \u003e\u003e\u003e frozen_dict = frozendict.fromkeys([\"x\", \"y\"], \"5\")\n   \u003e\u003e\u003e frozen_dict\n   frozendict({'x': '5', 'y': '5'})\n\n   # Test uniqueness: frozendict(a=1,b=2) == frozendict(b=2,a=1)\n   \u003e\u003e\u003e set([frozendict(a=1,b=2), frozendict(a=5), frozendict(b=2,a=1)])\n   {frozendict({'a': 5}), frozendict({'a': 1, 'b': 2})}\n\n\n🚀 Similar Projects Comparaison\n-------------------------------\n\nThis project is similar to `frozendict`_ created by `Marco Sulla`_.\n\n.. code-block:: python3\n\n   \u003e\u003e\u003e from frozndict import frozendict as myfrozendict\n   \u003e\u003e\u003e from frozendict import frozendict\n\n   # create instances\n   \u003e\u003e\u003e my_frozen_dict = myfrozendict({'x': 3, 'y': 4, 'z': {'a': 0, 'b': [3,1,{4,1},[5,9]]}}, c= 1)\n   \u003e\u003e\u003e frozen_dict = frozendict({'x': 3, 'y': 4, 'z': {'a': 0, 'b': [3,1,{4,1},[5,9]]}}, c= 1)\n   \u003e\u003e\u003e dict = dict({'x': 3, 'y': 4, 'z': {'a': 0, 'b': [3,1,{4,1},[5,9]]}}, c= 1)\n\n   # comparaison\n   \u003e\u003e\u003e import sys\n   \u003e\u003e\u003e tuple(map(sys.getsizeof, [frozen_dict, my_frozen_dict, dict]))\n   (248, 240, 232)\n\nNotice :code:`my_frozen_dict` takes less space in memory than :code:`frozen_dict`!\n\n🎉 Credits\n----------\n\nThe following projects were used to build and test :code:`frozndict`.\n\n- `python`_\n- `poetry`_\n- `pytest`_\n- `flake8`_\n- `coverage`_\n- `rstcheck`_\n- `mypy`_\n- `pytestcov`_\n- `tox`_\n- `isort`_\n- `black`_\n- `precommit`_\n\n\n👋 Contribute\n-------------\n\nIf you are looking for a way to contribute to the project, please refer to the `Guideline`_.\n\n📝 License\n----------\n\nThis program and the accompanying materials are made available under the terms and conditions of the `GNU GENERAL PUBLIC LICENSE`_.\n\n.. _GNU GENERAL PUBLIC LICENSE: http://www.gnu.org/licenses/\n.. _frozendict: https://pypi.org/project/frozendict/\n.. _Marco Sulla: https://github.com/Marco-Sulla\n.. _Guideline: https://github.com/Harmouch101/frozndict/blob/main/CONTRIBUTING.rst\n.. _pyenv: https://github.com/pyenv/pyenv\n.. _poetry: https://github.com/python-poetry/poetry\n.. _pipx: https://github.com/pypa/pipx\n.. _python: https://www.python.org/\n.. _pytest: https://docs.pytest.org/en/7.1.x/\n.. _flake8: https://flake8.pycqa.org/en/latest/\n.. _coverage: https://coverage.readthedocs.io/en/6.3.2/\n.. _rstcheck: https://pypi.org/project/rstcheck/\n.. _mypy: https://mypy.readthedocs.io/en/stable/\n.. _pytestcov: https://pytest-cov.readthedocs.io/en/latest/\n.. _tox: https://tox.wiki/en/latest/\n.. _isort: https://github.com/PyCQA/isort\n.. _black: https://black.readthedocs.io/en/stable/\n.. _precommit: https://pre-commit.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiseaidev%2Ffrozndict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiseaidev%2Ffrozndict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiseaidev%2Ffrozndict/lists"}