Closed pkoryzna closed 7 months ago
new from_dict() factory method allows creating DotDicts from nested Python dicts, such as API responses. Usage example:
from_dict()
>>> from dotdict import DotDict >>> nested = {"A": {"B": {"C": {"D": 1}}}} >>> abcd = DotDict.from_dict(nested) >>> abcd.A DotDict(B=DotDict(C=DotDict(D=1))) >>> abcd.A.B DotDict(C=DotDict(D=1)) >>> abcd.A.B.C DotDict(D=1) >>> abcd.A.B.C.D 1
Fixes issue #3
new
from_dict()
factory method allows creating DotDicts from nested Python dicts, such as API responses. Usage example:Fixes issue #3