|
|
from dateutil.parser import parse as date_parse
from gapi.apis.calendar_api.models import weekdays, Eventfrom gapi.apis.calendar_api import calendar_apiimport datetime
if __name__ == "__main__":
MY_API = calendar_api("fuck google") # ~~BODY EXAMPLE~~##~~BODY EXAMPLE~~ example = { "attendees": [{"email": "lpage@example.com"}, {"email": "sbrin@example.com"}], "description": "A chance to hear more about Google's\
developer products.", "end": { "dateTime": "2015-05-28T17:00:00-07:00", "timeZone": "America/Los_Angeles", }, "location": "800 Howard St., San Francisco, CA 94103", "recurrence": ["RRULE:FREQ=DAILY;COUNT=2"], "reminders": { "overrides": [ {"method": "email", "minutes": 1440}, {"method": "popup", "minutes": 10}, ], "useDefault": False, }, "start": { "dateTime": "2015-05-28T09:00:00-07:00", "timeZone": "America/Los_Angeles", }, "summary": "Google I/O 2015", } e = Event( date_parse("march 16, 2019 10:00 am"), date_parse("march 16, 2019 3:30 pm"), "Hang out with Matt", ) CAL_ID = "raphael.roberts48@gmail.com" event = Event.from_json(example) id = event.upload(MY_API, CAL_ID) print(id) e2 = Event.from_id(MY_API, CAL_ID, id) until = datetime.datetime.today() + datetime.timedelta(days=20) e2.add_weekly_recurrence(until, weekdays.MON, weekdays.TUE) e2.upload(MY_API, CAL_ID)
|