{"id":23288,"library":"attributedict","title":"AttributeDict","description":"Simple dictionary subclass that exposes keys as attributes (e.g., obj.mykey instead of obj['mykey']). Requires Python 3.5+. Currently maintained with steady releases.","status":"active","version":"0.3.0","language":"python","source_language":"en","source_url":"https://github.com/grimen/python-attributedict","tags":["dict","attribute-access","convenience","utility"],"install":[{"cmd":"pip install attributedict","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"attrdict is a different, older library with incompatible API.","wrong":"from attrdict import AttrDict","symbol":"AttributeDict","correct":"from attributedict import AttributeDict"},{"note":"The class is not exposed at the top-level module; must import explicitly.","wrong":"import attributedict","symbol":"AttributeDict","correct":"from attributedict import AttributeDict"}],"quickstart":{"code":"from attributedict import AttributeDict\n\n# Create an AttributeDict\naddr = AttributeDict({'city': 'Oslo', 'zip': '0150'})\n# Access keys as attributes\nprint(addr.city)  # Oslo\nprint(addr.get('zip'))  # '0150'\n# Set new attribute\naddr.country = 'Norway'\nprint(addr)  # {'city': 'Oslo', 'zip': '0150', 'country': 'Norway'}","lang":"python","description":"Basic usage showing attribute access, .get(), assignment, and dict representation."},"warnings":[{"fix":"Avoid using keys that conflict with dict methods, or use standard dict access for those keys.","message":"AttributeDict stores keys as attributes, which may shadow built-in methods (e.g., if your key is 'keys' or 'items').","severity":"gotcha","affected_versions":"all"},{"fix":"Recursively convert with: AttributeDict(nested_dict) for each level, or use a helper function.","message":"Nested dictionaries are only shallowly converted; nested dicts inside an AttributeDict remain standard dicts unless you explicitly wrap them.","severity":"gotcha","affected_versions":"all"},{"fix":"Evaluate if the library meets your needs; if you need ongoing support, migrate to box or attrdict.","message":"The library has not been updated since 2020; consider using more actively maintained alternatives like 'python-box' or 'attrdict' for newer Python versions.","severity":"deprecated","affected_versions":"0.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install attributedict' and use 'from attributedict import AttributeDict'.","cause":"Package not installed or import path wrong.","error":"ModuleNotFoundError: No module named 'attributedict'"},{"fix":"Use .get() to safely access: obj.get('mykey', default) or check existence with 'mykey' in obj.","cause":"Attempting to access a non-existent key via attribute.","error":"AttributeError: 'AttributeDict' object has no attribute 'mykey'"},{"fix":"Use .get() instead: obj.get('mykey', default).","cause":"Standard dict bracket notation still raises KeyError for missing keys.","error":"KeyError: 'mykey' when accessing via bracket"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}