/python-ngoschema

definition of classes with json-schema, object management and code-generation

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Overview

docs Documentation Status
tests
Requirements Status
package

Description

I'm Cedric ROMAN.

ngoschema aims at automate the building of classes based on a JSON schema.

User can declare all class attributes in a schema (along with their type, default value) and the class will be built with accessors to check and validate data.

User can add methods and override setters/getters, but the library provides a boiler plate to automatically create the class, nicely instrumented (with loggers, exception handling, type checking, data validation, serialization, etc...).

The classbuilder allows to easily load definitions based on a canonical name and a namespace.

Instance of these classes can be iterated and behave as standard collections.

ngoschema aims at being a toolkit for Domain-Driven Design and Model-Driven Architecture.

The library is build on top of python-jsonchema, a python implementation for JSON schema validation.

  • Free software: GNU General Public License v3

Installation

To install, with the command line:

pip install ngoschema

Documentation

https://python-ngoschema.readthedocs.io/

Settings are managed using simple-settings and can be overriden with configuration files (cfg, yaml, json) or with environment variables prefixed with NGOSCHEMA_.

Development

To run the all tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows
set PYTEST_ADDOPTS=--cov-append
tox
Other
PYTEST_ADDOPTS=--cov-append tox