omdata package¶
Submodules¶
omdata.design module¶
OpenMaker module for survey data schema.
This module contains functions and classes which can be used an editing interface to a predesigned JSON schema.
- Todo:
- Do the Sphinx documentation
- Improve inplace editing methods.
-
exception
omdata.design.
OMSchemaKeyError
(msg, code)[source]¶ Bases:
Exception
OpenMaker data schema error for invalid key types.
- Args:
- msg (str): Human readable string describing the exception.
code (
int
, optional): Error code. - Attributes:
- msg (str): Human readable string describing the exception. code (int): Exception error code.
-
exception
omdata.design.
OMSchemaUnknown
(msg, code)[source]¶ Bases:
Exception
OpenMaker data schema error for unknown object types.
- Args:
- msg (str): Human readable string describing the exception.
code (
int
, optional): Error code. - Attributes:
- msg (str): Human readable string describing the exception. code (int): Exception error code.
-
class
omdata.design.
Schema
(schema=None)[source]¶ Bases:
object
A generic interface object for JSON Schemas of OpenMaker Project.
- Attributes:
- schema_file (
string
): A file path to a JSON schema file.
-
load
(schema)[source]¶ The method loads a schema from a JSON object.
- Args:
- fname (
dict
): The JSON document in dictionary format. - Returns:
- bool: True.
-
load_from_file
(fname)[source]¶ The method loads a schema from a file path to a JSON schema file.
- Args:
- fname (str): The file path.
- Returns:
- bool: True if successful, False otherwise.
- Raises:
- FileNotFoundError: Raised if a given file is not accessable.
-
schema_file
= None¶
omdata.validator module¶
OpenMaker schema validator.
This module, until a fully custom version of it to be developed, uses jsonschema package for validation of survey response against openmaker design.
- Example:
- $ python validator.py -q ../docs/omsurvey.json -s ../docs/omsurvey.schema
- Todo:
- Do the Sphinx documentation