AttrDict is an MIT-licensed Python library (version 2.0.1) providing mapping objects that allow their elements to be accessed both as keys (like a standard dict) and as attributes. It aims to simplify the creation of hierarchical data structures, particularly useful for configuration objects. The project's last release was in 2019, and its GitHub repository was archived in the same year, indicating it is no longer actively maintained.
pip install attrdictVerified import paths — ran on the pinned version, not inferred.
Initialize an `AttrDict` from a dictionary and access its elements using attribute-style notation. Demonstrates both valid access and the `AttributeError` for non-existent attributes.
Consider using alternative libraries like `addict` or implementing similar functionality with `types.SimpleNamespace` for Python 3.10+ environments. The project is unmaintained.
For new projects, evaluate actively maintained alternatives like `addict` or `pydantic` for configuration management.
Be aware of this implicit type conversion. If you need to retain lists, consider using `AttrMap` and setting `sequence_type=None` or accessing via item notation (`attr['foo']['bar']`).
If you require a shallow copy that remains an `AttrDict`, you must explicitly convert the result: `new_attrdict = AttrDict(old_attrdict.copy())`.
If you need a decoupled instance, pass a copy of your dictionary: `settings = AttrDict(data.copy())`.
No dependency data recorded yet.