YAML data reader

YAML data reader reads files whose extension is .yaml or .yml.

[1]:
from galactic.io.data.core import PopulationFactory
import tempfile
from pprint import pprint

data = """\
# This is a YAML document.
- name: Galois
  firstname: Évariste
- name: Wille
  firstname: Rudolf
"""

with tempfile.NamedTemporaryFile(mode="w+t", suffix=".yaml") as file:
    file.write(data)
    file.seek(0)
    population = PopulationFactory.create(file)
    pprint({key: value for key, value in population.items()})
{'0': {'firstname': 'Évariste', 'name': 'Galois'},
 '1': {'firstname': 'Rudolf', 'name': 'Wille'}}