# YAML
{id: yaml}

## YAML - YAML Ain't Markup Language
{id: what-is-yamle}
{i: YAML}

* [YAML](https://yaml.org/)
* Documentation of the [PyYAML library](https://pyyaml.org/).

## Read YAML
{id: read-yaml}
{i: load}
{i: Loader}

![](examples/yaml/data.yaml)
![](examples/yaml/read_yaml.py)

## Write YAML
{id: write-yaml}
{i: dump}
{i: Dumper}

![](examples/yaml/write_yaml.py)
![](examples/yaml/out.yaml)


## Exercise: Counter in YAML
{id: exercise-yaml-counter}

Exactly like the same exercise in the JSON chapter, but use a YAML file as the "database".


## Exercise: Phone book in YAML
{id: exercise-yaml-phonebook}

Exactly like the same exercise in the JSON chapter, but use a YAML file as the "database".

## Solution: Counter in YAML
{id: solution-yaml-counter}

![](examples/yaml/yaml_counter.py)

