{"id":23635,"library":"dotted-dict","title":"DottedDict","description":"DottedDict is a dict subclass that allows accessing nested keys using dot notation (e.g., d.key.subkey). Currently at version 1.1.3. Release cadence is irregular; last update was in 2020.","status":"active","version":"1.1.3","language":"python","source_language":"en","source_url":"https://github.com/josh-paul/dotted_dict","tags":["dict","dot-notation","nested"],"install":[{"cmd":"pip install dotted-dict","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"The class is capitalized 'DottedDict'","wrong":"from dotted_dict import dotted_dict","symbol":"DottedDict","correct":"from dotted_dict import DottedDict"}],"quickstart":{"code":"from dotted_dict import DottedDict\n\nd = DottedDict({'a': {'b': 'value'}})\nprint(d.a.b)  # output: value","lang":"python","description":"Creates a DottedDict from a nested dict and accesses nested keys with dot notation."},"warnings":[{"fix":"Use d['new']['key'] = 'value' or pre-initialize the nested structure.","message":"DottedDict does not support dot notation assignment for creating new nested keys (e.g., d.new.key = 'value' will raise KeyError because intermediate keys are not auto-created).","severity":"gotcha","affected_versions":"all"},{"fix":"Access these methods via d.keys() (works on the object) but be aware that nested DottedDicts also override them; use dict(d['inner']).keys() if needed.","message":"DottedDict overrides __getattr__ to mimic dict keys, so attributes like d.keys, d.items, d.values are lost. Use d.keys() only on the DottedDict itself; nested DottedDicts also override these.","severity":"gotcha","affected_versions":"all"},{"fix":"Use DottedDict with nested structures; for lists, you must manually convert each element.","message":"DottedDict does not convert non-dict values to DottedDict. Only nested dicts are converted. Lists of dicts remain plain dicts.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Set using standard dict assignment: d['new'] = DottedDict({'key': 'value'})","cause":"DottedDict does not auto-create intermediate keys on dot assignment.","error":"KeyError: 'key' when trying to set d.new.key = 'value'"},{"fix":"Ensure nested values are DottedDict or use dict() conversion: dict(d['inner']).items()","cause":"Accessing .items() on the DottedDict itself works but on nested ones? Actually it doesn't - nested DottedDict does have items method, but the error may occur if the nested value is not a DottedDict.","error":"AttributeError: 'DottedDict' object has no attribute 'items'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}