Registry / serialization / nocasedict

nocasedict

JSON →
library2.2.0pypypi✓ verified 84d ago

A case-insensitive ordered dictionary for Python. Version 2.2.0, supports Python >=3.9. Released under Apache 2.0. Maintained with irregular releases.

pip install nocasedict
INSTALL
IMPORT
SIG · NOCASEDICT
N
nocasedict
serializationpythonv2.2.0
Install
1.5s avg
Import
12ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.012s · 18.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.012s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NocaseDict
from nocasedict import NocaseDict
import nocasedict.NocaseDict
NocaseDict is a top-level class, not a module.

Create a case-insensitive dictionary and access keys case-insensitively.

from nocasedict import NocaseDict d = NocaseDict({'KEY': 'value'}) print(d['key']) # 'value' print(d['KEY']) # 'value' d['NewKey'] = 1 print('newkey' in d) # True
Debug
Known issues
breakingVersion 2.0.0 dropped support for Python 2.7 and 3.5. Also changes how keys are stored internally; no more separate lowercase key store. Bulk import may break if using internal attributes.
fix
Upgrade to 2.x only if using Python >=3.6. Code relying on __dict__ or internal key storage will break.
affects: <2.0.0
deprecatedThe 'NocaseDict.fromkeys' class method is deprecated since 2.2.0 and will be removed in a future release.
fix
Use dict.fromkeys and convert: NocaseDict(dict.fromkeys(keys, value)).
affects: 2.2.0 and later
gotchaEquality comparison with regular dict is case-sensitive. NocaseDict('a':1) == {'a':1} is True, but NocaseDict('A':1) == {'a':1} is False.
fix
Be aware that case-insensitivity only applies within NocaseDict itself, not when comparing to dict.
affects: all
gotchaInheritance from NocaseDict may cause unexpected behavior because it overrides __setitem__ and __getitem__ for case-insensitivity. Custom subclasses must carefully call super().
fix
Ensure you override all relevant methods and call super().__setitem__ with the intended key.
affects: all
Errors
Common errors & fixes
ImportError: No module named 'nocasedict'
Library not installed or installed in a different Python environment.
fix
Run: pip install nocasedict
AttributeError: module 'nocasedict' has no attribute 'NocaseDict'
Incorrect import: trying to import from the module but the class is not found due to wrong import statement.
fix
Use: from nocasedict import NocaseDict
TypeError: 'NocaseDict' object does not support item assignment
Accidentally passed a frozen instance or tried to use mappingproxy-like behavior.
fix
Create a new NocaseDict from the frozen one: NocaseDict(frozen_dict)
Upgrade
Version history
2.2.0latest on PyPI · released Jan 4, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
nocasedict — pip install nocasedict · libregistry