/valohai-yaml

:book: Parses and validates valohai.yaml files.

Primary LanguagePythonMIT LicenseMIT

valohai-yaml

Build Status Codecov License: MIT

Parses and validates valohai.yaml files.

Installation

pip install valohai-yaml

Usage (validation)

Programmatic usage:

from valohai_yaml import validate, ValidationErrors

try:
    validate(open('my_yaml.yaml'))
except ValidationErrors as errors:
    print('oh no!')
    for err in errors:
        print(err)

Command-line usage:

valohai-yaml my_yaml.yaml
echo $?  # 1 if errors, 0 if ok

Usage (parsing)

from valohai_yaml import parse
config = parse(open('my_yaml.yaml'))
print(config.steps['cool step'].command)