[Python-ideas] Add a dict with the attribute access capability

Nick Timkovich prometheus235 at gmail.com
Wed Nov 29 12:43:34 EST 2017

On Wed, Nov 29, 2017 at 7:21 AM, Daniel Moisset <dmoisset at machinalis.com>

> As reference of prior art, there is https://pypi.python.org/pypi/munch in
> PyPI

Box is also popular as it permits deeper nesting:
https://pypi.python.org/pypi/python-box/ https://github.com/cdgriffith/Box
Addict is similar: https://pypi.python.org/pypi/addict/2.1.1
https://github.com/mewwts/addict and I've seen AttrDict a few times in code
I maintain: https://pypi.python.org/pypi/attrdict

With a cursory search, also found:
* DotMap: https://pypi.python.org/pypi/dotmap
* EasyDict https://pypi.python.org/pypi/easydict
* Treedict (older) https://pypi.python.org/pypi/treedict
* Bunch (older) https://pypi.python.org/pypi/bunch

...I spy a theme :P

Haven't dug into them that much, but I'd try to answer most questions with
how they do it. I'm not sure if the recursive 'items as attributes within
items as attributes...' feature is a can of worms or if it's something like
defaultdict(dict), but with more levels. Getting deeply nested items with
dots seems to be the usual use (i.e. complicated JSONs), and I think the
degree of laziness in creating/setting nested items is variable.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171129/3f7f54cd/attachment.html>

More information about the Python-ideas mailing list