Skip to main content

Models for working with JSON, ie: JsonModel

Project description

Json Modeling Library

Provides easy way to map dict to/from Full-Fledged 'JsonModel' object.

PythonSupport PyPI version

Documentation

📄 Detailed Documentation | 🐍 PyPi

Getting Started

???+ 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmodel-1.0.0.tar.gz (82.5 kB view hashes)

Uploaded Source

Built Distribution

xmodel-1.0.0-py3-none-any.whl (93.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page