PyDapt coverts a dictionary into an object. It is similar to the OpenStruct of ruby.
Python Version Required >= 3
pip install pydapt
from pydapt.models import PyFlex
dictionary = {"test": 1, "test1": {"test2": 2}}
pyflex = PyFlex(dictionary)
print(pyflex.test) # 1
print(pyflex.test1.test2) # 2from pydapt.models import PyFlex
dictionary = {"test": 1, "test1": {"test2": 2}}
pyflex = PyFlex(dictionary, test3=3, test4=4)
print(pyflex.test) # 1
print(pyflex.test1.test2) # 2
print(pyflex.test3) # 3
print(pyflex.test4) # 4from pydapt.models import PyFlex
dictionary = {"test": 1, "test1": {"test2": 2}}
pyflex = PyFlex(dictionary)
print(pyflex.test) # 1
print(pyflex.test1.test2) # 2
pyflex.drop('test3') # None
pyflex.drop('test') # 1
print(pyflex.test) # AttributeError: 'PyFlex' object has no attribute 'test'