I recently came across the 'Box' library which does the same thing.
Installation command : pip install python-box
Example:
from box import Boxmydict = {"key1":{"v1":0.375,"v2":0.625},"key2":0.125, }mydict = Box(mydict)print(mydict.key1.v1)
I found it to be more effective than other existing libraries like dotmap, which generate python recursion error when you have large nested dicts.
link to library and details: https://pypi.org/project/python-box/