Skip to content

Instantly share code, notes, and snippets.

@eikenb
Created June 21, 2017 20:10
Show Gist options
  • Save eikenb/549d3b100de1f9a14cf61182aafe40ff to your computer and use it in GitHub Desktop.
Save eikenb/549d3b100de1f9a14cf61182aafe40ff to your computer and use it in GitHub Desktop.
0365 calendar example
#!/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