ValidVIA#

class ethology.annotations.validators.ValidVIA(path)[source]#

Bases: object

Class for valid VIA JSON files.

It checks the input file is a valid JSON file, matches the VIA schema and contains the required keys.

path#

Path to the VIA JSON file, passed as an input.

Type:

Path | str

schema#

The JSON schema is set to the default VIA schema.

Type:

dict

required_keys#

The required keys for the VIA JSON file.

Type:

dict

Raises:
  • ValueError – If the JSON file cannot be decoded.

  • jsonschema.exceptions.ValidationError – If the type of any of the keys in the JSON file does not match the type specified in the schema.

  • jsonschema.exceptions.SchemaError – If the schema is invalid.

  • ValueError – If the VIA JSON file is missing any of the required keys.