How to access iCal-Server core via Python

I am trying to access Apples iCal-Server on a Mac OS X Snow Leopard server through Python. The server is up and running with it through the iCal application. Now I need to access this server through Python in order to use it as a base for resource planning. I already looked at the CalDav module ( http://packages.python.org/caldav/index.html ), but the sample provided there did not find any calendar, the URL is correct.

So how can I read events within a time range from a user calendar using python?

+3
source share
1 answer

[Not a solution, but debugging]

, caldav:

from datetime import datetime
import caldav
from caldav.elements import dav, cdav

# Principal url
url = "https://user:pass@hostname/user/Calendar"

client = caldav.DAVClient(url)
principal = caldav.Principal(client, url)
calendars = principal.calendars()

  • URL- URL- ical-
  • = main.calendars(), .
  • URL- , - .

:

objects.py, DAVObject, . , . , .

    response = self.client.propfind(self.url.path, body, depth)
    print response, self.url.path #provide additional info
    print response.raw  #provide additional info
    for r in response.tree.findall(dav.Response.tag):
+1

Source: https://habr.com/ru/post/1765774/


All Articles