Created
June 21, 2017 20:10
-
-
Save eikenb/549d3b100de1f9a14cf61182aafe40ff to your computer and use it in GitHub Desktop.
0365 calendar example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import subprocess | |
import time | |
import O365 as o365 | |
username = 'foo@bar.com' | |
passwd = 'passwd' | |
s = o365.Schedule((username, passwd)) | |
s.getCalendars() | |
def event2Rem(ev): | |
rem = ['REM'] | |
start = ev.getStart() | |
rem.append(time.strftime("%b %d %Y +1 AT %H:%M", start)) | |
rem.append(ev.getSubject()) | |
return " ".join(rem) | |
cal = s.calendars[0] | |
cal.getEvents() | |
for e in cal.events: | |
#print(e.toJson()) | |
print(event2Rem(e)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment