optionaldict
A dict-like object that ignore NoneType values for Python
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
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 · maintenance · safety
permissive license (permissive) — MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license text.
last release 2021-01-15 (2037 days) · last repo commit 2021-01-15 · 5 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 157,527 downloads/mo, #10,754 on PyPI
Alternatives
Verify before relying
pip install optionaldict
from optionaldict import optionaldict
d = optionaldict(a=1, b=None)
d['c'] = 2
print(d) # None values are omitted- 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
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 on this page. Verify before relying on it.
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
optionaldict on PyPI
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 | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 2,037 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 157,527 / month, #10,754 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities |
Evidence: optionaldict-0.1.2-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “dict that ignores none values”
- optionaldictA dict subclass that automatically omits None values when storing or…
- rtomlrtoml parses and serializes TOML files and strings to and from Python…
- vonage-utilsProvides utility functions and error types for the Vonage Python SDK,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also itypes · frozendict · mo-dots · dill · multidict · sqlitedict · flatten-dict · orjson · json-ref-dict