How to Export a calDAV-Web-Calendar to local ICS-File

368 views Asked by At

With th following code I parse a calDAV-Calendar. Works fine. But HOW can I export the whole Calendar to a local ICS-file?

import caldav

caldav_url = "XXXXXXXXXXXXXX"
username = "***************"

client = caldav.DAVClient(url=caldav_url,username=username, password="xxxx")
my_principal = client.principal()

calendars = my_principal.calendars()
my_calendar = my_principal.calendar(name="xxxxxxxxxxxxx")

all_events = my_calendar.events()
for event in all_events:
   try:
       print(event.vobject_instance.vevent.summary.value)
       pass
   except Exception:
       pass
0

There are 0 answers