newtheatre/history-project

View on GitHub
_bin/person_list_generator.py

Summary

Maintainability
A
0 mins
Test Coverage
# Console outputs a person list

import os
import csv

with open('tmp/person_list_input.csv') as csvfile:
    csvreader = csv.reader(csvfile)
    for row in csvreader:
        stream = open('tmp/person_list_output.yml', 'a')
        stream.write( """  - role: {}\n    name: {}\n""".format(row[0], row[1])
        )
        stream.close()