calendaring_sync.adapters.caldav module#
The CalDAV adapter, which syncs one calendar collection through python-caldav.
It needs the caldav extra, as Install shows.
Adapters explains every rule it follows, and
Server compatibility how each tested server behaves.
- calendaring_sync.adapters.caldav.FINGERPRINT_SCHEME = 'caldav-canonical-1'#
The name of the canonical fingerprint this adapter computes. A change to how it’s computed gets a new name, so every scope is listed again.
- calendaring_sync.adapters.caldav.MEDIA_TYPE = 'text/calendar'#
The media type of a CalDAV scope’s content, iCalendar data.
- calendaring_sync.adapters.caldav.MULTIGET_SIZE = 100#
How many objects one
calendar-multigetfetches, and one page of a full listing holds.
- class calendaring_sync.adapters.caldav.CalDAVAdapter(replica, calendar, *, scope_id=None)[source]#
Bases:
SyncAdapterSyncs one calendar collection through a synchronous python-caldav client.
The calendar is one scope. The content
create()andchange()take is iCalendar data in UTF-8, and a create’s must hold an object with aUID; anything else raisesValueError. A write the server won’t take as it was sent becomes a conflict of kindNOT_ALLOWED. Any other failure python-caldav reports, such as a refused login, reaches you as itscaldav.lib.error.DAVError, unchanged.- Parameters:
- Raises:
TypeError – If the calendar is on an asynchronous client, or an argument has the wrong type.
ValueError – If the calendar has no URL or no client.
Examples
A sync, an edit, and the sync that pushes it:
adapter = CalDAVAdapter(replica, calendar) adapter.sync() key = adapter.create(ics_bytes) adapter.sync()
- property needs_full_listings: bool#
Whether the server may leave changes out without refusing the scope’s token.
Read from the server profile configured on the client, python-caldav’s
sync-token.invalid-tokenfeature;Adapter.needs_full_listingssays what to do when it’sTrue.
- class calendaring_sync.adapters.caldav.AsyncCalDAVAdapter(replica, calendar, *, scope_id=None)[source]#
Bases:
AsyncAdapterCalDAVAdapterfor a calendar on an asynchronous client.Its methods are coroutines, as
AsyncAdapterdescribes; everything else is asCalDAVAdapterdescribes.- Raises:
TypeError – If the calendar is on a synchronous client, or an argument has the wrong type.
ValueError – If the calendar has no URL or no client.
- property needs_full_listings: bool#
Whether the server may leave changes out without refusing the scope’s token.
Read from the server profile configured on the client, python-caldav’s
sync-token.invalid-tokenfeature;Adapter.needs_full_listingssays what to do when it’sTrue.