calendaring_jmap.convert.jscal_to_ical module#
JSCalendar to iCalendar conversion (RFC 8984 to RFC 5545).
- Public API:
jscal_to_ical(jscal: dict) -> str
Accepts a raw JSCalendar CalendarEvent dict (as returned by CalendarEvent/get or produced by ical_to_jscal). Returns a VCALENDAR string.
- calendaring_jmap.convert.jscal_to_ical.jscal_to_ical(jscal)[source]#
Convert a JSCalendar CalendarEvent dict to an iCalendar VCALENDAR string.
Handles the full set of fields supported by
ical_to_jscalfor round-trip fidelity.recurrenceOverridesentries withexcluded: truebecome EXDATE properties; patch dicts become child VEVENTs with RECURRENCE-ID.- Parameters:
jscal (
dict) – A raw JSCalendar CalendarEvent dict as returned byCalendarEvent/get.- Return type:
- Returns:
An iCalendar VCALENDAR string, normalised by
fixup.- Raises:
ValueError – If
uidis absent or empty (mandatory per RFC 8984 Section 4.1.2; a server response should always include it, but emitting anUID-less VEVENT, invalid per RFC 5545, would be a worse failure mode than raising here).