access_nri_intake.utils#
General utility functions for access-nri-intake
Functions#
|
Read in the required JSON schema, and annotate it with "required" fields. |
|
Load a metadata.yaml file, leaving dates as strings, and validate against a jsonschema, |
|
Validate a dictionary against a jsonschema, allowing for tuples as arrays |
|
Module Contents#
- access_nri_intake.utils.get_jsonschema(metadata_file, required)#
Read in the required JSON schema, and annotate it with “required” fields.
- Parameters:
- required: list
A list of the properties to include in the “required” key
- access_nri_intake.utils.load_metadata_yaml(path, jsonschema)#
Load a metadata.yaml file, leaving dates as strings, and validate against a jsonschema, allowing for tuples as arrays
- Parameters:
- paths: str
The path to the metadata.yaml
- access_nri_intake.utils.validate_against_schema(instance, schema)#
Validate a dictionary against a jsonschema, allowing for tuples as arrays
- Parameters:
- instance: dict
The instance to validate
- schema: dict
The jsonschema
- Raises:
- jsonschema.exceptions.ValidationError
If the instance does not match the schema
- access_nri_intake.utils.get_catalog_fp(basepath=None)#