Simple python data objects management and validation based on standard jsonschema concepts. Project requires python3.6+ and allows users define how data objects should look and relate with other data objects. Supports python3.6+ typing annotations and customs attributes for more complex relationships.
- Define and demarcate data objects with just python annotations
- Define constraints in simple jsonschema compliant manner
- Validate data objects using standard jsonschema validators
- Express complete jsonschema as simple data objects (its just objects)
install from pip
$ pip install justobjectsinstall from source
$ pip install git+https://github.com/kulgan/justobjects@<version>#egg=justobjectsimportjsonimportjustobjectsasjo@jo.data(typed=True)classModel:
a: intb: floatc: str# display schemaprint(json.dumps(jo.show_schema(Model), indent=2))
try:
# fails validationjo.validate(Model(a=3.1415, b=2.72, c="123"))
exceptjo.ValidationExceptionaserr:
print(err.errors)The fastest way to get feedback on contributions/bugs is create a issues
The project makes use of tox to run tests and other common tasks
$ tox -e py36