Module trase.tools.data_release_package.validate.cli
CLI to validate that a local folder adheres to the "data release package" specification (see doc/Data-Release-Package.md).
How to Add a New Validation:
See trase/tools/data_release_package/validate/validators/init.py. Validations that read the
actual data from S3 should be marked with @accesses_s3, so --skip-s3 can leave them
out.
Execution:
When run (python -m trase.tools.data_release_package.validate <path>), all validation
functions are executed against the given folder. One PASS line per check is printed to
stdout, followed by a summary line; failures and their details go to stderr. The script
exits with a non-zero status code if any issues are found, making it suitable for
integration into CI pipelines like GitHub Actions.
Functions
def add_arguments(parser: argparse.ArgumentParser) ‑> Nonedef get_all_validation_functions() ‑> List[Callable[[pathlib.Path], Iterator[str]]]def main(args) ‑> bool-
Runs all validation checks against args.path.
Returns
bool- True if any errors were found, otherwise False.
def run() ‑> Nonedef run_validations(path: pathlib.Path, functions: List[Callable[[pathlib.Path], Iterator[str]]]) ‑> bool-
Runs the given validation checks against
path, printing one line per check to stdout and any discovered issues to stderr.Returns
bool- True if any errors were found, otherwise False.
def select_validation_functions(args) ‑> List[Callable[[pathlib.Path], Iterator[str]]]-
The validations to run, after applying –only, –skip and –skip-s3.