Provides easy way to map dict to/from Full-Fledged 'JsonModel' object.
📄 Detailed Documentation | 🐍 PyPi
???+ warning "Alpha Software!" This is pre-release Alpha software, based on another code base and the needed changes to make a final release version are not yet completed. Everything is subject to change!
poetry install xmodel
or
pip install xmodel
Very basic example:
from xmodel import JsonModel
class MyModel(JsonModel):
some_attr: str
json_dict_input = {'some_attr': 'a-value'}
obj = MyModel(json_dict_input)
assert obj.some_attr == 'a-value'
json_dict = obj.api.json()
assert json_dict == json_dict_input