Validation Profile

Specification

Each key (except those beginning with _) in the specification specifies a validator that should be used.

Note

The _required key can be used to specify a list of validators that must pass when executed.

Each validator key is a list of configurations of the validator that should be applied on different sets of files.

  • exclude - A list of relative paths that should be excluded from the validation

  • include - A list of relative paths that should be included in the validation

  • context - Specifies how and/or where is the correct value stored

  • options - A dict with validator-specific options

Note

XML-variables can be used with the {VARIABLE}-syntax in the configuration values. See XML Variables for more information.

Built-in validators

ChecksumValidator

class ESSArch_Core.fixity.validation.backends.checksum.ChecksumValidator(*args, **kwargs)[source]

Validates the checksum of a file against the given context.

  • context specifies how the input is given and must be one of checksum_file, checksum_str and xml_file

  • options

    • algorithm must be one of md5, sha-1, sha-224, sha-256, sha-384 and sha-512. Defaults to md5

    • block_size: Defaults to 65536

StructureValidator

class ESSArch_Core.fixity.validation.backends.structure.StructureValidator(context=None, include=None, exclude=None, options=None, data=None, required=True, task=None, ip=None, responsible=None, stylesheet=None)[source]

Validates that the directory has all the required files and no invalid extensions.

The tree option specifies a set of rules for directories:

  • type must be either root or folder and is only used to specify if we are at the root or not. If folder is specified then we also require the name option to be specified.

  • name tells us which folder is being described

  • required_files is a list with files that must be in the directory

  • valid_paths is a list of strings and/or lists that are allowed in the directory. Wildcards can be specified using *.

    Inner lists are used to specify valid file groups. E.g. [['*.doc', '*.pdf']] says that for each .doc file there must be a .pdf file with the same name.