--- id: nocasedict version: "2.2.0" license: LGPL-2.1-or-later license_treatment: copyleft maintenance: active --- # nocasedict — A case-insensitive list for Python License: copyleft · Maintenance: active · Downloads: 107.8K/mo ## What it is and what it does NocaseDict is an ordered dictionary implementation that performs case-insensitive key lookups while preserving the original lexical case of keys as they were inserted. When you access a key, the lookup is case-insensitive (so 'ALPHA', 'alpha', and 'Alpha' all retrieve the same value), but when you print or iterate the dictionary, keys appear in their original form. The package implements the full Python 3.14 dict API on all supported Python versions (3.9+), with customizable casefolding behavior via str.casefold() for unicode strings and bytes.lower() for byte strings by default. It also provides mixin classes for adding hashability and attribute-based key access, making it suitable for scenarios where case-insensitive matching is needed without sacrificing the ability to preserve the original key format. Use it for: - HTTP header handling where header names are case-insensitive but original casing should be preserved in responses - Configuration file parsing where option names are matched case-insensitively but displayed in their original form - API parameter matching where user input may vary in case but should map to canonical keys - Database column name lookups where case-insensitive matching is needed but original column names must be retained ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A case-insensitive ordered dictionary that preserves the original lexical case of its keys, supporting the full dict API with customizable casefolding. Yes, if you need case-insensitive dictionary semantics with key-case preservation. The package is actively maintained, production-stable, has low install friction, and covers a genuine use case not well-served by existing alternatives. The LGPL-2.1-or-later license requires attention in proprietary projects but poses no barrier for open-source work. ## Install pip install nocasedict uv add nocasedict poetry add nocasedict ## Installing nocasedict Before you install: Low install friction with a single runtime dependency (typing-extensions). Actively maintained with recent commits and production-stable status across modern Python versions. License in practice: Licensed under LGPL-2.1-or-later (copyleft). Derivative works and modifications must be released under compatible terms; suitable for open-source projects but requires care in proprietary contexts. Quickstart: pip install nocasedict from nocasedict import NocaseDict dict1 = NocaseDict({'Alpha': 1, 'Beta': 2}) print(dict1['ALPHA']) # Returns 1 print(dict1) # Prints NocaseDict({'Alpha': 1, 'Beta': 2}) Verify before relying: - Performance characteristics compared to standard dict for large datasets - Behavior when keys differ only in case (e.g., 'Alpha' vs 'ALPHA' as separate inserts) ## Package facts - License: LGPL-2.1-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 107.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags case-insensitive dictionary, case-insensitive dict python, ordered dict case-insensitive, casefold dictionary, case-insensitive key lookup, case-insensitive, data-structure [View on SkillFed](https://skillfed.io/packages/nocasedict) · [View on PyPI](https://pypi.org/project/nocasedict/)