Skip to content

Yaml

pip install pyyaml
import yaml


with open('./starships.yaml') as f:
    starships = yaml.safe_load(f)

There is a load method but it requires specifying one of four possible values for the Loader kwarg.

import yaml


with open('./starships.yaml','w') as f:
    yaml.dump(starships, f)
Resources