Skip to content

Instantly share code, notes, and snippets.

@tosiara
Created January 2, 2023 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tosiara/2f3b9e7666c11285e4ee887d8228bee7 to your computer and use it in GitHub Desktop.
Save tosiara/2f3b9e7666c11285e4ee887d8228bee7 to your computer and use it in GitHub Desktop.
Parse ical Google Calendar export
from icalendar import Calendar, Event
g = open("sun.ics","rb")
gcal = Calendar.from_ical(g.read())
for component in gcal.walk():
if component.name == "VEVENT":
print(component.get('summary'), component.get('dtstart').dt)
g.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment