--- id: deflate-dict version: "1.2.2" license: MIT license_treatment: permissive maintenance: dormant --- # deflate-dict — Package to deflate and inflate dictionaries. License: permissive · Maintenance: dormant · Downloads: 86.6K/mo ## What it is and what it does Deflate Dict is a utility for converting nested dictionaries into flat, single-level dictionaries and back again. It works by traversing nested structures—dicts and lists—and creating flattened keys that encode the path to each leaf value using a configurable separator. The inverse operation, inflate, reconstructs the original nested structure from the flattened keys. This is useful when you need to serialize, store, or transmit nested data in a format that expects flat key-value pairs, or when you want to apply operations uniformly across all leaf values without recursion. The package has no runtime dependencies and is straightforward to install. It supports optional type encoding to preserve the original types of keys during the flatten-unflatten cycle. Maintenance is dormant, with the last update in October 2024, so bug fixes or feature additions are unlikely without community contribution. Use it for: - Convert nested configuration dictionaries to flat environment variables or flat config files for deployment. - Serialize nested API responses or database records into a single-level format for storage or transmission. - Flatten hierarchical data structures for machine learning feature engineering or data analysis pipelines. - Create lookup tables or caches from nested data where keys encode the full path to each value. - Debug or inspect deeply nested dictionaries by viewing all leaf values with their full paths at once. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Flattens nested dictionaries into single-level key-value pairs using a separator, and reconstructs them back to their original nested structure. Yes, if you have a specific need to flatten and unflatten nested dictionaries and accept that the package is not actively maintained. The code is simple, has no dependencies, and carries no security vulnerabilities. MIT licensing is unrestrictive. However, dormant maintenance means no bug fixes or Python version updates are forthcoming—use it only for stable, self-contained use cases where you can own any future fixes. ## Install pip install deflate-dict uv add deflate-dict poetry add deflate-dict ## Installing deflate-dict Before you install: High install friction with no compiled dependencies. Maintenance is dormant—last commit was 2024-10-26, but the package has not been updated in 657 days and shows minimal community engagement (2 stars). Installation will succeed, but ongoing support is uncertain. License in practice: MIT license is permissive and imposes no restrictions on use, modification, or redistribution in proprietary or open-source projects. Quickstart: pip install deflate_dict from deflate_dict import deflate, inflate D = {"a": [{"b": (0, 1, 2)}, {"c": [1, 2, 3]}]} flat = deflate(D, sep="_") restored = inflate(flat, sep="_") Verify before relying: - Whether type_encode_key parameter correctly preserves and restores all Python types during round-trip deflate/inflate cycles. - Performance characteristics with very large or deeply nested dictionaries. - Compatibility with Python versions beyond the unspecified support range. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: dormant - Downloads: 86.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags flatten nested dictionary, deflate inflate dict, nested dict to flat, dictionary serialization, flatten dict keys, nested structure flattening, data-structure, serialization [View on SkillFed](https://skillfed.io/packages/deflate-dict) · [View on PyPI](https://pypi.org/project/deflate-dict/)