[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![License: MIT](https://img.shields.io/badge/License-MIT-blueviolet.svg)](https://opensource.org/licenses/MIT)
[![codecov](https://codecov.io/gh/tybruno/caseless-dictionary/branch/main/graph/badge.svg?token=ZO94EJFI3G)](https://codecov.io/gh/tybruno/caseless-dictionary)
# caseless-dictionary
A simple, fast, typed, and tested implementation for a python3.6+ case-insensitive dictionary. This class extends and
maintains the original functionality of the builtin `dict`.
#### Key Features:
* **Easy**: If you don't care about the case of the key in a dictionary then this implementation is easy to use since it
acts just like a `dict` obj.
* **Great Developer Experience**: Being fully typed makes it great for editor support.
* **Fully Tested**: Our test suit fully tests the functionality to ensure that `CaselessDict` runs as expected.
* **There is More!!!**:
* [ModifiableItemsDict](https://github.com/tybruno/modifiable-items-dictionary): CaselessDict is built on top of
the `ModifiableItemsDict`, which is a library that enables the user to modify the key or/and value of `dict` type
object at runtime.
## Installation
`pip install caseless-dictionary`
## Simple CaselessDict Example
```python
from caseless_dictionary import CaselessDict
normal_dict: dict = {" CamelCase ": 1, " UPPER ": "TWO", 3: " Number as Key "}
caseless_dict: CaselessDict = CaselessDict(normal_dict)
print(caseless_dict) # {'camelcase': 1, 'upper': 'TWO', 3: 'Number as Key'}
print("CamelCase" in caseless_dict) # True
print("camelcase" in caseless_dict) # True
print(caseless_dict[" camelCASE "]) # 1
```
## Simple UpperCaselessDict Example
```python
from caseless_dictionary import UpperCaselessDict
from typing import Iterable
iterable: Iterable = [(" wArNIng", 0), ("deBug ", 10)]
upper_caseless_dict: dict = UpperCaselessDict(iterable)
print(upper_caseless_dict) # {'WARNING': 0, 'DEBUG': 10}
print("warning" in upper_caseless_dict) # True
upper_caseless_dict["WarninG"] = 30
print(upper_caseless_dict) # {'WARNING': 30, 'DEBUG': 10}
```
## Simple TitleCaselessDict Example
```python
from caseless_dictionary import TitleCaselessDict
from typing import Iterable
iterable: Iterable = {" Brave ": 1, " ProtonMail ": 2}
title_caseless_dict: dict = TitleCaselessDict(iterable)
print(title_caseless_dict) # {'Brave': 1, 'Protonmail': 2}
title_caseless_dict.pop(" protonMAIL ")
print(title_caseless_dict) # {'Brave': 1}
```
## Acknowledgments
During the class '(Advanced) Python For Engineers III' taught by [Raymond Hettinger](https://github.com/rhettinger),
Raymond taught us how to inherit from the builtin Python `dict` by creating a Case-insensitive Dict.
I thought this was a wonderful learning experience so I decided to create a project that would build upon what he
taught.
Raw data
{
"_id": null,
"home_page": "https://github.com/tybruno/caseless-dictionary",
"name": "caseless-dictionary",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "python dict dictionary",
"author": "Tyler Bruno",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/d3/22/a0a99f26a0d836b814d5fb6d52905221ae881f3993541622b40ffb1f3736/caseless-dictionary-1.0.3.tar.gz",
"platform": null,
"description": "[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)\n[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blueviolet.svg)](https://opensource.org/licenses/MIT)\n[![codecov](https://codecov.io/gh/tybruno/caseless-dictionary/branch/main/graph/badge.svg?token=ZO94EJFI3G)](https://codecov.io/gh/tybruno/caseless-dictionary)\n# caseless-dictionary\n\nA simple, fast, typed, and tested implementation for a python3.6+ case-insensitive dictionary. This class extends and\nmaintains the original functionality of the builtin `dict`.\n\n#### Key Features:\n\n* **Easy**: If you don't care about the case of the key in a dictionary then this implementation is easy to use since it\n acts just like a `dict` obj.\n* **Great Developer Experience**: Being fully typed makes it great for editor support.\n* **Fully Tested**: Our test suit fully tests the functionality to ensure that `CaselessDict` runs as expected.\n* **There is More!!!**:\n * [ModifiableItemsDict](https://github.com/tybruno/modifiable-items-dictionary): CaselessDict is built on top of\n the `ModifiableItemsDict`, which is a library that enables the user to modify the key or/and value of `dict` type\n object at runtime.\n\n## Installation\n\n`pip install caseless-dictionary`\n\n## Simple CaselessDict Example\n\n```python\nfrom caseless_dictionary import CaselessDict\n\nnormal_dict: dict = {\" CamelCase \": 1, \" UPPER \": \"TWO\", 3: \" Number as Key \"}\n\ncaseless_dict: CaselessDict = CaselessDict(normal_dict)\n\nprint(caseless_dict) # {'camelcase': 1, 'upper': 'TWO', 3: 'Number as Key'}\n\nprint(\"CamelCase\" in caseless_dict) # True\nprint(\"camelcase\" in caseless_dict) # True\n\nprint(caseless_dict[\" camelCASE \"]) # 1\n```\n\n## Simple UpperCaselessDict Example\n\n```python\nfrom caseless_dictionary import UpperCaselessDict\nfrom typing import Iterable\n\niterable: Iterable = [(\" wArNIng\", 0), (\"deBug \", 10)]\nupper_caseless_dict: dict = UpperCaselessDict(iterable)\nprint(upper_caseless_dict) # {'WARNING': 0, 'DEBUG': 10}\n\nprint(\"warning\" in upper_caseless_dict) # True\n\nupper_caseless_dict[\"WarninG\"] = 30\nprint(upper_caseless_dict) # {'WARNING': 30, 'DEBUG': 10}\n```\n\n## Simple TitleCaselessDict Example\n\n```python\nfrom caseless_dictionary import TitleCaselessDict\nfrom typing import Iterable\n\niterable: Iterable = {\" Brave \": 1, \" ProtonMail \": 2}\ntitle_caseless_dict: dict = TitleCaselessDict(iterable)\nprint(title_caseless_dict) # {'Brave': 1, 'Protonmail': 2}\n\ntitle_caseless_dict.pop(\" protonMAIL \")\n\nprint(title_caseless_dict) # {'Brave': 1}\n```\n\n## Acknowledgments\n\nDuring the class '(Advanced) Python For Engineers III' taught by [Raymond Hettinger](https://github.com/rhettinger),\nRaymond taught us how to inherit from the builtin Python `dict` by creating a Case-insensitive Dict.\nI thought this was a wonderful learning experience so I decided to create a project that would build upon what he\ntaught.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Typed and Tested Case Insensitive Dictionary which was inspired by Raymond Hettinger",
"version": "1.0.3",
"project_urls": {
"Homepage": "https://github.com/tybruno/caseless-dictionary"
},
"split_keywords": [
"python",
"dict",
"dictionary"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "97317e68fcdf62ce4ac0a8287baf145ea548d0f18d959ef8a6ef93e46ed06eab",
"md5": "2ef9b0f68ecee1d90c40b693907fe65e",
"sha256": "4cae721b30412cfaff2777a242d7fd20e570c680f076a28158aa8d197deab1d4"
},
"downloads": -1,
"filename": "caseless_dictionary-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2ef9b0f68ecee1d90c40b693907fe65e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 5224,
"upload_time": "2023-08-17T18:53:32",
"upload_time_iso_8601": "2023-08-17T18:53:32.948113Z",
"url": "https://files.pythonhosted.org/packages/97/31/7e68fcdf62ce4ac0a8287baf145ea548d0f18d959ef8a6ef93e46ed06eab/caseless_dictionary-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d322a0a99f26a0d836b814d5fb6d52905221ae881f3993541622b40ffb1f3736",
"md5": "68b6fb7d54ae144b568aa2215fb2da30",
"sha256": "ec2725dc137b46c570576385deef495cd99ea30947985ccd2af24ee513c98f31"
},
"downloads": -1,
"filename": "caseless-dictionary-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "68b6fb7d54ae144b568aa2215fb2da30",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 6825,
"upload_time": "2023-08-17T18:53:34",
"upload_time_iso_8601": "2023-08-17T18:53:34.642848Z",
"url": "https://files.pythonhosted.org/packages/d3/22/a0a99f26a0d836b814d5fb6d52905221ae881f3993541622b40ffb1f3736/caseless-dictionary-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-17 18:53:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tybruno",
"github_project": "caseless-dictionary",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "caseless-dictionary"
}