{"repo":"mewwts/addict","free":true,"listed":false,"github":"https://github.com/mewwts/addict","clone":"git clone https://github.com/mewwts/addict.git","description":"The Python Dict that's better than heroin.","language":"Python","stars":2546,"topics":["addict","python-dict","dictionaries","dict","python","recurse"],"license":"MIT","category":"dev-tools","readme_excerpt":"addict addict is a Python module that gives you dictionaries whose values are both gettable and settable using attributes, in addition to standard item-syntax. This means that you don't have to write dictionaries like this anymore: Instead, you can simply write the following three lines: Installing You can install via pip or through conda Addict runs on Python 2 and Python 3, and every build is tested towards 2.7, 3.6 and 3.7. Usage addict inherits from , but is more flexible in terms of accessing and setting its values. Working with dictionaries are now a joy ! Setting the items of a nested Dict is a dream : If the Dict is instantiated with any iterable values, it will iterate through and clone these values, and turn dict s into Dict s. Hence, the following works but mapping['a'] is no longer the same reference as dictionary['a'] . This behavior is limited to the constructor, and not when items are set using attribute or item syntax, references are untouched: Stuff to keep in mind Remember that s are not valid attribute names, so keys of the dict that are not strings must be set/get with the get-/setitem syntax However feel free to mix the two syntaxes: Attributes like keys, items etc. addict will not let you override attributes that are native to , so the following will not work However, the following is fine just like a regular dict . There are no restrictions (other than what a regular dict imposes) regarding what keys you can use. Default values For keys that are not in ","default_branch":null,"files":null,"tree":[],"storefront":"/r/mewwts","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mewwts/addict/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}