Skip to main content

Valohai.yaml validation and parsing

Project description

valohai-yaml

Build Status Codecov License: MIT

Parses and validates valohai.yaml files.

Valohai YAML files are used to define how your machine learning project workloads and pipelines are ran on the Valohai ecosystem. Refer to Valohai Documentation to learn how to write the actual YAML files and for more in-depth usage examples.

Installation

pip install valohai-yaml

Usage

Validation

Programmatic usage:

from valohai_yaml import validate, ValidationErrors

try:
    with open('path/to/valohai.yaml') as f:
        validate(f)
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

Parsing

from valohai_yaml import parse

with open('path/to/valohai.yaml') as f:
    config = parse(f)

print(config.steps['cool step'].command)

Development

# setup development dependencies
pip install -e . -r requirements-test.txt pre-commit
pre-commit install

# run linting and type checks
pre-commit run --all-files

# run tests
pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

valohai_yaml-0.27.0.tar.gz (36.7 kB view hashes)

Uploaded Source

Built Distribution

valohai_yaml-0.27.0-py3-none-any.whl (42.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page