{"id":21117,"library":"deflate-dict","title":"deflate-dict","description":"A Python library for inflating and deflating nested dictionaries. Deflate flattens nested dicts into key paths, and inflate reverses the process. Current version 1.2.2, stable maintenance.","status":"active","version":"1.2.2","language":"python","source_language":"en","source_url":"https://github.com/LucaCappelletti94/deflate_dict","tags":["dictionary","flatten","nest","utility"],"install":[{"cmd":"pip install deflate-dict","lang":"bash","label":"Default install"}],"dependencies":[],"imports":[{"note":"Top-level import is preferred.","wrong":"from deflate_dict.deflate import deflate","symbol":"deflate","correct":"from deflate_dict import deflate"},{"note":"Top-level import is preferred.","wrong":"from deflate_dict.inflate import inflate","symbol":"inflate","correct":"from deflate_dict import inflate"}],"quickstart":{"code":"from deflate_dict import deflate, inflate\nnested = {'a': {'b': 1, 'c': 2}}\nflat = deflate(nested)\nprint(flat)  # {'a.b': 1, 'a.c': 2}\nrestored = inflate(flat)\nprint(restored)  # {'a': {'b': 1, 'c': 2}}","lang":"python","description":"Deflate a nested dict and inflate it back."},"warnings":[{"fix":"deflate(nested, separator='__') or inflate(flat, separator='__')","message":"Default separator is '.' which can clash with keys containing dots. Use `separator` parameter to choose a safe delimiter.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure no ambiguous key patterns before inflating.","message":"Inflation assumes no overlapping key paths. If a flattened key like 'a.b' and a nested key like 'a' with value exist, behavior may be unexpected.","severity":"gotcha","affected_versions":"all"},{"fix":"Convert non-string keys to strings before deflating.","message":"The library does not handle non-string keys for deflation. Keys must be strings or convertible to strings.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure nested values are dicts, not lists. Wrap lists in a dict if needed.","cause":"Passing a list as a value deeply nested; deflate expects dicts as nested structures.","error":"TypeError: unhashable type: 'list'"},{"fix":"Check that the flat dict contains keys exactly matching the deflated output, or use custom separator consistently.","cause":"Inflation attempted on a flat dict missing some expected keys or using wrong separator.","error":"KeyError: 'some.path'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}