]> code.communitydata.science - coldcallbot-discord.git/blob - download_student_info.py
Merge branch 'COM481-2024Q4'
[coldcallbot-discord.git] / download_student_info.py
1 #!/usr/bin/env python3
2
3 import json
4 import subprocess
5
6 with open("configuration.json", 'r') as config_file:
7     config = json.loads(config_file.read())
8
9 base_url = 'https://docs.google.com/spreadsheets/d/{id}/export?gid={gid}&format=tsv'
10
11 student_info_url = base_url.format(id=config["student_info_gsheet_id"], gid=config["student_info_gsheet_gid"])
12 subprocess.run(["wget", url, "-O", config["student_info_file"]], check=True)
13
14 optout_url = base_url.format(id=config["optout_info_gsheet_id"], gid=config["output_info_gsheet_gid"])
15 subprocess.run(["wget", optout_url, "-O", config["optout_file"]], check=True)

Community Data Science Collective || Want to submit a patch?