You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

16 lines
490 B

from gcalendar import calendar_api
import json
import pprint
api = calendar_api("class", r"api_info\client_secret.json", "api_info")
cals = api.get_calendars()
cal = next(
filter(lambda cal: cal["id"] == api.ids["Raphael's School Schedule".lower()], cals)
)
with open("classes.json") as file:
bodies = json.load(file)
for body in bodies:
# body['colorId'] = cal['colorId']
# pprint.pprint(body)
# input()
api.create_event("Raphael's School Schedule".lower(), body)