API¶
The API is consists of separate layers.
The upper layer supplies convenience functions for handling timetables, for
example merging and summarizing of timetables. The implementation is found in
timetable.timetable
:
generate_timetable |
Generates a timetable from all items of type itemtype in the given calendar. |
annotate_timetable |
Annotates all entries of timetable with the result of all annotate_funcs. |
cut_timetable |
Generates a timetable by cutting entries of timetable at the given cuts datetimes. |
merge_intersections |
Generates a timetable with merged intersection of entries in timetable. |
merge_timetables |
Generates a merged timetable from the given timetables. |
sum_timetable |
Computes a dictionary with timeseries of the activity for each key in the given cuts. |
The middle layer handles grouping of calendar items as well as evaluating
recurrences and timezones. It is implemented in timetable.event
:
uidgroups_by_type |
Selects all items of type itemtype in the calendar and groups them into a dictionary based on their UID. |
generate_item_timetable |
Generates a timetable for a calendar item. |
The lowest layer supplies functions for
parsing iCal data and is implemented in the module timetable.ical
:
Item |
Represents an iCal item. |
Entry |
Represents an iCal entry. |
parse_ical |
Parses the icalfile and returns a list of Item . |
Furthermore, there is also a small utility module timetable.util
available:
datetime_range |
Generates dates from start (inclusive) to end (exclusive) with the given step. |