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.

12 lines
416 B

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