Metadata-Version: 2.1
Name: valohai-yaml
Version: 0.28.0
Summary: Valohai.yaml validation and parsing
Project-URL: Homepage, https://github.com/valohai/valohai-yaml
Author-email: Valohai <info@valohai.com>
License-Expression: MIT
License-File: LICENSE
Keywords: strings,utility
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.7
Requires-Dist: jsonschema
Requires-Dist: pyyaml
Description-Content-Type: text/markdown

# valohai-yaml

[![Build Status](https://github.com/valohai/valohai-yaml/actions/workflows/ci.yml/badge.svg)](https://github.com/valohai/valohai-yaml/actions/workflows/ci.yml)
[![Codecov](https://codecov.io/gh/valohai/valohai-yaml/branch/master/graph/badge.svg)](https://codecov.io/gh/valohai/valohai-yaml)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/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](https://valohai.com/) ecosystem. Refer to [Valohai Documentation](https://docs.valohai.com/) to learn how to write the actual YAML files and for more in-depth usage examples.

## Installation

```bash
pip install valohai-yaml
```

## Usage

### Validation

Programmatic usage:

```python
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:

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

### Parsing

```python
from valohai_yaml import parse

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

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

# Development

```bash
# 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
```
