{"id":18319741,"url":"https://github.com/developerrsquared/case-insensitive-dict","last_synced_at":"2025-04-05T22:31:35.107Z","repository":{"id":37956856,"uuid":"453805374","full_name":"DeveloperRSquared/case-insensitive-dict","owner":"DeveloperRSquared","description":"Typed Python Case Insensitive Dictionary","archived":false,"fork":false,"pushed_at":"2024-04-29T17:11:14.000Z","size":191,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-29T18:30:52.999Z","etag":null,"topics":["development","dict","pypi","python","python3","tooling","utils"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/case-insensitive-dictionary/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeveloperRSquared.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"github":["rikhilrai"],"custom":"https://www.paypal.me/rikhilrai"}},"created_at":"2022-01-30T21:22:20.000Z","updated_at":"2024-06-17T19:02:54.870Z","dependencies_parsed_at":"2023-02-02T19:31:53.250Z","dependency_job_id":"3c5664f4-3d9c-4bdc-a8ac-8ab4f0b03e15","html_url":"https://github.com/DeveloperRSquared/case-insensitive-dict","commit_stats":{"total_commits":70,"total_committers":4,"mean_commits":17.5,"dds":0.4714285714285714,"last_synced_commit":"1df9e205a36c58026bc8a7f244abbc40ea2e0e7f"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeveloperRSquared%2Fcase-insensitive-dict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeveloperRSquared%2Fcase-insensitive-dict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeveloperRSquared%2Fcase-insensitive-dict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeveloperRSquared%2Fcase-insensitive-dict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeveloperRSquared","download_url":"https://codeload.github.com/DeveloperRSquared/case-insensitive-dict/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411236,"owners_count":20934650,"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":["development","dict","pypi","python","python3","tooling","utils"],"created_at":"2024-11-05T18:14:08.236Z","updated_at":"2025-04-05T22:31:34.874Z","avatar_url":"https://github.com/DeveloperRSquared.png","language":"Python","readme":"# Case Insensitive Dict\n\nTyped Python Case Insensitive Dictionary\n\n[![Publish](https://github.com/DeveloperRSquared/case-insensitive-dict/actions/workflows/publish.yml/badge.svg)](https://github.com/DeveloperRSquared/case-insensitive-dict/actions/workflows/publish.yml)\n\n[![Python 3.7+](https://img.shields.io/badge/python-3.7+-brightgreen.svg)](#case-insensitive-dict)\n[![PyPI - License](https://img.shields.io/pypi/l/case-insensitive-dictionary.svg)](LICENSE)\n[![PyPI - Version](https://img.shields.io/pypi/v/case-insensitive-dictionary.svg)](https://pypi.org/project/case-insensitive-dictionary)\n\n[![CodeQL](https://github.com/DeveloperRSquared/case-insensitive-dict/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/DeveloperRSquared/case-insensitive-dict/actions/workflows/codeql-analysis.yml)\n[![codecov](https://codecov.io/gh/DeveloperRSquared/case-insensitive-dict/branch/main/graph/badge.svg?token=45JCHX8KT9)](https://codecov.io/gh/DeveloperRSquared/case-insensitive-dict)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/DeveloperRSquared/case-insensitive-dict/main.svg)](https://results.pre-commit.ci/latest/github/DeveloperRSquared/case-insensitive-dict/main)\n\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat\u0026labelColor=ef8336)](https://pycqa.github.io/isort/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n\n## Install\n\nInstall and update using [pip](https://pypi.org/project/case-insensitive-dictionary/).\n\n```sh\n$ pip install -U case-insensitive-dictionary\n```\n\n## API Reference\n\n| Method                    | Description                                                                                                                                         |\n|:--------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------|\n| clear()                   | Removes all elements from the dictionary.                                                                                                           |\n| copy()                    | Returns a copy of the dictionary.                                                                                                                   |\n| get(key, default)         | Returns the value (case-insensitively), of the item specified with the key.\u003cbr\u003eFalls back to the default value if the specified key does not exist. |\n| getkey(key)               | Returns the original case-sensitive key using a case-insensitive search.                                                                            |\n| fromkeys(iterable, value) | Returns a dictionary with the specified keys and the specified value.                                                                               |\n| keys()                    | Returns the dictionary's keys.                                                                                                                      |\n| values()                  | Returns the dictionary's values.                                                                                                                    |\n| items()                   | Returns the key-value pairs.                                                                                                                        |\n| pop(key)                  | Remove the specified item (case-insensitively).\u003cbr\u003eThe value of the removed item is the return value.                                               |\n| popitem()                 | Remove the last item that was inserted into the dictionary.\u003cbr\u003eFor Python version \u003c3.7, popitem() removes a random item.                            |\n\n## Example\n\nCaseInsensitiveDict:\n\n```py\n\u003e\u003e\u003e from typing import Union\n\n\u003e\u003e\u003e from case_insensitive_dict import CaseInsensitiveDict\n\n\u003e\u003e\u003e case_insensitive_dict = CaseInsensitiveDict[Union[str, int], str](data={\"Aa\": \"b\", 1: \"c\"})\n\u003e\u003e\u003e case_insensitive_dict[\"aa\"]\n'b'\n\u003e\u003e\u003e case_insensitive_dict[1]\n'c'\n\u003e\u003e\u003e case_insensitive_dict.getkey(\"aa\")\n'Aa'\n\n```\n\nwhich also supports json encoding/decoding:\n\n```py\n\u003e\u003e\u003e import json\n\n\u003e\u003e\u003e from case_insensitive_dict import CaseInsensitiveDict, CaseInsensitiveDictJSONEncoder, case_insensitive_dict_json_decoder\n\n\u003e\u003e\u003e case_insensitive_dict = CaseInsensitiveDict[str, str](data={\"Aa\": \"b\"})\n\u003e\u003e\u003e json_string = json.dumps(obj=case_insensitive_dict, cls=CaseInsensitiveDictJSONEncoder)\n\u003e\u003e\u003e json_string\n'{\"Aa\": \"b\"}'\n\n\u003e\u003e\u003e case_insensitive_dict = json.loads(s=json_string, object_hook=case_insensitive_dict_json_decoder)\n\u003e\u003e\u003e case_insensitive_dict\nCaseInsensitiveDict({'Aa': 'b'})\n```\n\n## Contributing\n\nContributions are welcome via pull requests.\n\n### First time setup\n\n```sh\n$ git clone git@github.com:DeveloperRSquared/case-insensitive-dict.git\n$ cd case-insensitive-dict\n$ poetry install\n$ poetry shell\n```\n\nTools including black, mypy etc. will run automatically if you install [pre-commit](https://pre-commit.com) using the instructions below\n\n```sh\n$ pre-commit install\n$ pre-commit run --all-files\n```\n\n### Running tests\n\n```sh\n$ poetry run pytest\n```\n\n## Links\n\n- Source Code: \u003chttps://github.com/DeveloperRSquared/case-insensitive-dict/\u003e\n- PyPI Releases: \u003chttps://pypi.org/project/case-insensitive-dictionary/\u003e\n- Issue Tracker: \u003chttps://github.com/DeveloperRSquared/case-insensitive-dict/issues/\u003e\n","funding_links":["https://github.com/sponsors/rikhilrai","https://www.paypal.me/rikhilrai"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperrsquared%2Fcase-insensitive-dict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloperrsquared%2Fcase-insensitive-dict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperrsquared%2Fcase-insensitive-dict/lists"}