Skip to main content

An immutable dict

Project description

Python Immutable Dict

badge

This library contains the ImmutableDict, a Python dictionary which can't be updated.

How to use it

  1. Install it from pip

pip install adaendra-immutable-dict

  1. Import the AdaendreImmutableDict

from adaendra_immutable_dict.AdaendraImmutableDict import AdaendraImmutableDict

  1. Use it like in the following examples.

Examples

from adaendra_immutable_dict.AdaendraImmutableDict import AdaendraImmutableDict

# Empty Immutable Dict
immutable_dict = AdaendraImmutableDict({})

# Non empty Immutable Dict
immutable_dict = AdaendraImmutableDict({"hello": "world"})

# Get a value
immutable_dict["hello"]
#> world

# Copy dict
immutable_dict_copy = immutable_dict.copy()

# Create an immutable dict from "fromkeys" method
immutable_dict = AdaendraImmutableDict.fromkeys(["a", "b"], "1")

Documentation


Credits

This project is based on Marco Sulla's project: frozen-dict.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adaendra_immutable_dict-1.0.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

adaendra_immutable_dict-1.0.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file adaendra_immutable_dict-1.0.0.tar.gz.

File metadata

  • Download URL: adaendra_immutable_dict-1.0.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for adaendra_immutable_dict-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bff88d05fe9bbcade7b3ffbb96114eda3ce82dbeb6824a68aafcf16ccabfc6d9
MD5 2da95f123eee31ddeeae12a69cc74a3a
BLAKE2b-256 6a7b1d1320b924197e5a417ba292b112e44d427fd688f612b8de8444c2e213e8

See more details on using hashes here.

File details

Details for the file adaendra_immutable_dict-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: adaendra_immutable_dict-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for adaendra_immutable_dict-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a77b6f38884b0e3f475d681ae7497e4e7bf28674c76cddf730e3ffa2e1ea59ef
MD5 f4dc54037b5d551c0a3bd14bb9b9440b
BLAKE2b-256 3da5f57c97930c32aa2dd72aa5db39efe4cb38bb1d560ab0a7ccf454d7e33021

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page