-
Notifications
You must be signed in to change notification settings - Fork 2
/
Runner.py
68 lines (52 loc) · 2.46 KB
/
Runner.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import rank_calculator
import csv
schoolslink = "https://docs.google.com/spreadsheets/d/e/2PACX-1vR4d8JvuxteLJ7NqAvZhjYzRggjV_ptKUQCNNsQAVrblK9r2h3CFovSODtSpg7Jp7_xt0lFdLjxUedQ/pub?output=csv"
coedRegattaLink = "https://docs.google.com/spreadsheets/d/e/2PACX-1vRYuBfRn534EQy6tXw957Ree0IPLUxyaFri25OQtd_0n5SyG3J-5ELfpUPgwUKGxT_qfDmzrmtds8Y2/pub?output=csv"
womensRegattaLink = "https://docs.google.com/spreadsheets/d/e/2PACX-1vRrN9Sdev0TpLnAzuUgPQFwEa_VXcmsXX9CKoR3Y5p4fFydyh8WwdM1Xx-yaOWobLlNYPYWUMjGql1w/pub?output=csv"
coed_rankings_output_file = "rankings.csv"
coed_component_scores_file = "component_scores.csv"
womens_rankings_output_file = "womensrankings.csv"
womens_component_scores_file = "womens_component_scores.csv"
################## COED ######################
ranks, school_objects = rank_calculator.calculate_ranks(coedRegattaLink, schoolslink)
f = open(coed_rankings_output_file, "w")
f.truncate()
f.close()
with open(coed_rankings_output_file, 'w') as result:
writer = csv.writer(result, delimiter=",")
writer.writerow(('School', 'Score'))
for row in ranks:
row = (row[0], str(row[1]))
writer.writerow(row)
f = open(coed_component_scores_file, "w")
f.truncate()
f.close()
with open(coed_component_scores_file, 'w') as result:
writer = csv.writer(result, delimiter=",")
writer.writerow(('School', 'Counted Scores Regular Regattas', 'Championship Score'))
for school in school_objects:
obje = school_objects[school]
row = (obje.name, obje.counted_points, obje.s_regatta_score)
writer.writerow(row)
######################################################
################### WOMENS ###########################
ranks, school_objects = rank_calculator.calculate_ranks(womensRegattaLink, schoolslink)
f = open(womens_rankings_output_file, "w")
f.truncate()
f.close()
with open(womens_rankings_output_file, 'w') as result:
writer = csv.writer(result, delimiter=",")
writer.writerow(('School', 'Score'))
for row in ranks:
row = (row[0], str(row[1]))
writer.writerow(row)
f = open(womens_component_scores_file, "w")
f.truncate()
f.close()
with open(womens_component_scores_file, 'w') as result:
writer = csv.writer(result, delimiter=",")
writer.writerow(('School', 'Counted Scores Regular Regattas', 'Championship Score'))
for school in school_objects:
obje = school_objects[school]
row = (obje.name, obje.counted_points, obje.s_regatta_score)
writer.writerow(row)