--- id: optionaldict version: "0.1.2" license: unclear license_treatment: permissive maintenance: abandoned --- # optionaldict — A dict-like object that ignore NoneType values for Python License: permissive · Maintenance: abandoned · Downloads: 157.5K/mo ## What it is and what it does optionaldict is a dict subclass that silently drops None values during assignment and storage, reducing boilerplate when building sparse data structures. It supports all standard dict operations and can be pickled or converted to JSON without special handling. The package is minimal and dependency-free, making it trivial to install. However, it has not been maintained since January 2021, so there is no guarantee of compatibility with Python versions released after that date or any edge cases discovered in real-world use. Use it for: - Building API request payloads where None fields should be omitted rather than sent as null - Storing configuration objects where unset options should not appear in serialized output - Reducing conditional logic when constructing dictionaries with optional fields - Creating sparse data structures for caching or logging without explicit None filtering - Serializing model objects to JSON while automatically excluding unset attributes ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A dict subclass that automatically omits None values when storing or serializing, and is both picklable and JSON-serializable. Yes, if you need a simple None-filtering dict for a new project and are comfortable with an unmaintained package. The code is straightforward enough that bugs are unlikely, but do not rely on it for critical systems or expect updates if incompatibilities emerge with future Python versions. For most use cases, a custom wrapper or a conditional dict comprehension is safer. ## Install pip install optionaldict uv add optionaldict poetry add optionaldict ## Installing optionaldict Before you install: Installation is frictionless—a pure-Python wheel with no runtime dependencies. However, the package has been abandoned since January 2021 (over 5 years without updates), so expect no bug fixes or compatibility work for newer Python versions. License in practice: MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text. Quickstart: pip install optionaldict from optionaldict import optionaldict d = optionaldict(a=1, b=None) d['c'] = 2 print(d) # None values are omitted Verify before relying: - Whether None-filtering behavior applies to all dict operations (update, fromkeys, etc.) or only direct assignment - Whether the package works reliably with Python 3.10+ despite no updates since 2021 - JSON serialization behavior when nested structures contain None values ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 157.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags dict that ignores none values, optional dict python, dict without none keys, none-filtering dictionary, json serializable dict, picklable dict, sparse dict implementation, data-structure, serialization [View on SkillFed](https://skillfed.io/packages/optionaldict) · [View on PyPI](https://pypi.org/project/optionaldict/)