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

  1. from gcalendar import calendar_api
  2. import json
  3. import pprint
  4. api = calendar_api("class", r"api_info\client_secret.json", "api_info")
  5. cals = api.get_calendars()
  6. cal = next(
  7. filter(lambda cal: cal["id"] == api.ids["Raphael's School Schedule".lower()], cals)
  8. )
  9. with open("classes.json") as file:
  10. bodies = json.load(file)
  11. for body in bodies:
  12. # body['colorId'] = cal['colorId']
  13. # pprint.pprint(body)
  14. # input()
  15. api.create_event("Raphael's School Schedule".lower(), body)