objects – Object definitions

class caldav.objects.DAVObject(client, url=None, parent=None, name=None, id=None)

Base class for all DAV objects.

children(type=None)

List children, using a propfind (resourcetype) on the parent object, at depth = 1.

delete()

Delete the object.

get_properties(props=[], depth=0)

Get properties (PROPFIND) for this object. Works only for properties, that don’t have complex types.

Parameters:
  • props = [dav.ResourceType(), dav.DisplayName(), ...]
Returns:
  • {proptag: value, ...}
save()

Save the object. This is an abstract methed, that all classes derived .from DAVObject implement.

Returns:
  • self
set_properties(props=[])

Set properties (PROPPATCH) for this object.

Parameters:
  • props = [dav.DisplayName(‘name’), ...]
Returns:
  • self
class caldav.objects.Principal(client, url)

This class represents a DAV Principal. It doesn’t do much, except play the role of the parent to all calendar collections.

calendars()

List all calendar collections in this principal.

Returns:
  • [Calendar(), ...]
class caldav.objects.Calendar(client, url=None, parent=None, name=None, id=None)

The Calendar object is used to represent a calendar collection. Refer to the RFC for details: http://www.ietf.org/rfc/rfc4791.txt

Search events by date in the calendar. Recurring events are expanded if they have an occurence during the specified time frame.

Parameters:
  • start = datetime.today().
  • end = same as above.
Returns:
  • [Event(), ...]
event(uid)

Get one event from the calendar.

Parameters:
  • uid: the event uid
Returns:
  • Event() or None
events()

List all events from the calendar.

Returns:
  • [Event(), ...]
save()

The save method for a calendar is only used to create it, for now. We know we have to create it when we don’t have a url.

Returns:
  • self
class caldav.objects.Event(client, url=None, data=None, parent=None, id=None)

The Event object is used to represent an event.

data

vCal representation of the event

instance

vobject instance of the event

load()

Load the event from the caldav server.

save()

Save the event, can be used for creation and update.

Returns:
  • self

Previous topic

DAVClient – A simple DAV client

This Page