s365b.modules.exchange.ics¶
iCalendar (.ics) export of backed-up events and tasks.
Events become VEVENT and tasks VTODO components (RFC 5545), which
Outlook, Apple Calendar, Google Calendar and Thunderbird import.
Graph stores times in UTC (Prefer: outlook.timezone is not sent), with
the zone the organizer used (originalStartTimeZone, usually a Windows
name such as “Pacific Standard Time”). Times are written in that zone, as
an IANA name with its VTIMEZONE, so a weekly 09:00 meeting stays at
09:00 across daylight saving time. All-day events and due dates are plain
dates.
Not in the export: single occurrences of a recurring meeting that were changed or cancelled (Graph’s backup has the series only), attachments, and To Do checklist steps as separate items (they are listed in the description).
Attributes¶
Functions¶
|
The IANA zone for a Graph time zone name (Windows or IANA); UTC if unknown. |
|
A Graph |
|
A backed-up event as a |
|
A backed-up To Do task as a |
|
Events and tasks as one iCalendar file. |
Module Contents¶
- s365b.modules.exchange.ics.zone(name: str | None) zoneinfo.ZoneInfo[source]¶
The IANA zone for a Graph time zone name (Windows or IANA); UTC if unknown.
- Parameters:
name – E.g. “Pacific Standard Time” or “Europe/Paris”.
- Returns:
The zone.
- s365b.modules.exchange.ics.rrule(recurrence: dict[str, Any] | None, start: datetime.datetime | datetime.date) dict[str, Any] | None[source]¶
A Graph
patternedRecurrenceas an iCalendarRRULE.- Parameters:
recurrence – The recurrence from Graph.
start – The first occurrence (a date for all-day events and tasks).
- Returns:
The rule’s parts, or
Noneif there is no (supported) recurrence.
- s365b.modules.exchange.ics.event_component(event: dict[str, Any]) icalendar.Event[source]¶
A backed-up event as a
VEVENT.- Parameters:
event – The event as Graph returned it.
- Returns:
The component.
- s365b.modules.exchange.ics.task_component(task: dict[str, Any]) icalendar.Todo[source]¶
A backed-up To Do task as a
VTODO.- Parameters:
task – The task as Graph returned it (with
checklistItemsif any).- Returns:
The component.
- s365b.modules.exchange.ics.to_ics(items: list[tuple[str, dict[str, Any]]], name: str | None = None) bytes[source]¶
Events and tasks as one iCalendar file.
- Parameters:
items –
(item type, Graph JSON)pairs; types other thaneventandtaskare left out.name – Calendar name shown by some programs (e.g. the calendar’s).
- Returns:
The
.icsfile.