## Config


Base class of every configuration: YAML on disk, JSON Schema for tools.


Usage

``` python
Config(**data)
```


Subclasses declare fields as pydantic models do. A config is frozen, refuses unknown fields and refuses non-finite floats, so its YAML, its JSON and its schema agree. Validation errors are [ConfigError](ConfigError.md#dazflow.ConfigError).


## Examples

``` python
>>> class SelectConfig(Config):
...     metric: str = "rmse"
...     tolerance: float = 0.05
>>> SelectConfig.from_yaml("tolerance: 0.1\n").to_yaml()
```

'metric: rmse: 0.1'


## Methods

| Name | Description |
|----|----|
| [dump()](#dump) | Write [to_yaml()](Config.md#dazflow.Config.to_yaml) to a UTF-8 file. |
| [from_yaml()](#from_yaml) | Validate a configuration from YAML text. |
| [json_schema()](#json_schema) | The JSON Schema (draft 2020-12) of this configuration. |
| [load()](#load) | Read and validate a configuration from a UTF-8 YAML file. |
| [to_yaml()](#to_yaml) | The configuration as YAML, every default filled in, fields in declaration order. |

------------------------------------------------------------------------


#### dump()


Write [to_yaml()](Config.md#dazflow.Config.to_yaml) to a UTF-8 file.


Usage

``` python
dump(path)
```


------------------------------------------------------------------------


#### from_yaml()


Validate a configuration from YAML text.


Usage

``` python
from_yaml(text)
```


------------------------------------------------------------------------


#### json_schema()


The JSON Schema (draft 2020-12) of this configuration.


Usage

``` python
json_schema()
```


------------------------------------------------------------------------


#### load()


Read and validate a configuration from a UTF-8 YAML file.


Usage

``` python
load(path)
```


------------------------------------------------------------------------


#### to_yaml()


The configuration as YAML, every default filled in, fields in declaration order.


Usage

``` python
to_yaml()
```
