bep032tools.validator package

Submodules

bep032tools.validator.BEP032Validator module

bep032tools.validator.BEP032Validator.build_rule_regexp(rules)

Function that create rules base on the regexp in rulesStructured.py

Parameters:

rules (list) – list of filenames

Returns:

concatenate every extension with is respective file

Return type:

list

Examples

if : file_name_regexp = [[‘sub-([a-zA-Z0-9]+)_ses-([a-zA-Z0-9]+)([w-]*)_ephys’]] then , list_of_rules = [‘sub-([a-zA-Z0-9]+)_ses-([a-zA-Z0-9]+)([w-]*)_ephys.tsv’]

bep032tools.validator.BEP032Validator.is_valid(input_directory)

Checks the validity of a data set with respect to the BIDS-animal-ephys specifications. The specifications that define what is checked by this function is available in the following document: https://bids.neuroimaging.io/bep032

Parameters:

input_directory (string) – Name of the root directory containing the data set to be checked

Returns:

a tuple of size 2 containing

boolean : True if the data set follows the ephys-BIDS specification; False if not

list : List of errors (empty if the data set is valid)

Return type:

tuple

bep032tools.validator.BEP032Validator.main()

Main file of the BEP032Validator.

Examples

Usage via command line:

BEP032Validator.py [-h] [-v] path

positional arguments: path

Name of the directory that contains the data set to be checked

optional arguments:

-h, –help, -v, –verbose

bep032tools.validator.BEP032Validator.search(rules, where)

This method evaluates if a string matches a particular pattern (rule) using REGEXP :param rules: regular expression pattern to match against :type rules: str :param where: string to be matched :type where: str

Returns:

None if the pattern is not found True if it is

Return type:

boolean

Module contents