forked from hackupc/old-judging2017f
-
Notifications
You must be signed in to change notification settings - Fork 0
/
new-table-assigner.py
45 lines (34 loc) · 1.12 KB
/
new-table-assigner.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import csv, random
table_list = [i for i in range(1,95)]
expo_list = ["1"]
#get submissions from csv
title_col = "Submission Title"
description_col = "Plain Description"
tracks_row = "Opt-in prize"
link_col = "Submission Url"
# room_col = "What Room Are You In?"
# table_col = "What's Your Table Number?"
input_path = 'data/submissions.csv'
output_full_path = 'data/data.csv'
output_gavel_path = 'data/data_gavel.csv'
full = []
with open(input_path) as csvfile:
submissions_reader = list(csv.DictReader(csvfile))
for row in submissions_reader:
print(row[title_col])
full.append(row)
# write full file (for expo website)
with open(output_full_path, 'w') as csvfile:
fieldnames = ['room','table', 'project', 'tracks', 'link']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
for row in full:
print(row[tracks_row])
writer.writerow(
{
# 'room': row[room_col],
# 'table': row[table_col],
'project': row[title_col],
'tracks': row[tracks_row],
'link': row[link_col]
})