aiida_crystal17.validation package

Module contents

aiida_crystal17.validation.load_schema(path)[source]

read and return a json schema

if the path is absolute, it will be used as is, otherwise it will be joined with the path to the internal json schema folder

Parameters

path (str) –

Returns

Return type

dict

aiida_crystal17.validation.load_validator(schema)[source]

create a validator for a schema

Parameters

schema (str or dict) – schema or path to schema

Returns

the validator to use

Return type

jsonschema.IValidator

aiida_crystal17.validation.validate_against_schema(data, schema)[source]

validate json-type data against a schema

Parameters
  • data (dict) –

  • schema (dict or str) – schema or path to schema

Raises
Returns

return True if validated

Return type

bool