17
0
coldcallbot/download_student_info.py
Benjamin Mako Hill 56fb61e8b0 many new changes for the new quarter
- switched to using a configuration.json file
- reworked the download_student_info.py to fix bugs
- substantial change to the scripts to use the new config structure
- other small changes
- wrote a new README file based on the old readme and material I sent
  to Matt McGarrity
2024-09-28 17:35:37 -07:00

16 lines
612 B
Python
Executable File

#!/usr/bin/env python3
import json
import subprocess
with open("configuration.json", 'r') as config_file:
config = json.loads(config_file.read())
base_url = 'https://docs.google.com/spreadsheets/d/{id}/export?gid={gid}&format=tsv'
student_info_url = base_url.format(id=config["student_info_gsheet_id"], gid=config["student_info_gsheet_gid"])
subprocess.run(["wget", student_info_url, "-O", config["student_info_file"]], check=True)
optout_url = base_url.format(id=config["optout_gsheet_id"], gid=config["optout_gsheet_gid"])
subprocess.run(["wget", optout_url, "-O", config["optout_file"]], check=True)