Add input parameter files

etta-drone
Dan Howe 6 years ago
parent 83615467cb
commit f9d975a02e

@ -0,0 +1,18 @@
import os
import re
import yaml
import pandas as pd
from glob import glob
excel_names = glob('*.xlsx')
for excel_name in excel_names:
print('processing {}'.format(excel_name))
df = pd.read_excel(excel_name)
survey_id, _ = os.path.splitext(excel_name)
for i, row in df.iterrows():
beach = row['BEACH'].replace('_', '-').lower()
yaml_name = '{}-{}.yaml'.format(survey_id, beach)
with open(yaml_name, 'w') as f:
f.write(yaml.dump(row.to_dict(), default_flow_style=False))

Binary file not shown.
Loading…
Cancel
Save