aboutsummaryrefslogtreecommitdiff
path: root/build.py
blob: 870f0fe3995222fa2e46c5728066c94daa841e47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import json

with open('fall-2021.json', 'r') as fall_fd:
    fall = json.load(fall_fd)

last_fall = fall[-1]

with open('spring-2022.json', 'r') as spring_fd:
    spring = json.load(spring_fd)

data = []
for point in fall:
    point['hospitalizations'] = -1
    data.append(point)

for point in spring:
    point['new_staff'] = point['new_staff'] + last_fall['new_staff']
    point['new_students'] = point['new_students'] + last_fall['new_students']
    point['total_staff'] = point['total_staff'] + last_fall['total_staff']
    point['total_students'] = point['total_students'] + last_fall['total_students']
    data.append(point)

with open('public/data.json', 'w') as data_fd:
    json.dump(data, data_fd, indent=2)