diff options
Diffstat (limited to 'build.py')
-rw-r--r-- | build.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/build.py b/build.py new file mode 100644 index 0000000..870f0fe --- /dev/null +++ b/build.py @@ -0,0 +1,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) |