1.10. ics
¶
This module provides functionality for creating RFC 5545 compliant iCalendar invite files.
1.10.1. Data¶
1.10.2. Functions¶
-
get_timedelta_for_offset
(offset)[source]¶ Take a POSIX environment variable style offset from UTC and convert it into a
timedelta
instance suitable for use with theicalendar
.Parameters: offset (str) – The offset from UTC such as “-5:00” Returns: The parsed offset. Return type: datetime.timedelta
-
get_tz_posix_env_var
(tz_name)[source]¶ Get the timezone information in the POSIX TZ environment variable format from the IANA timezone data files included in the
pytz
package.Parameters: tz_name (str) – The name of the timezone to get the environment variable for such as “America/New_York”. Returns: The TZ environment variable string, if it is specified in the timezone data file. Return type: str
-
parse_tz_posix_env_var
(posix_env_var)[source]¶ Get the details regarding a timezone by parsing the POSIX style TZ environment variable.
Parameters: posix_env_var (str) – The POSIX style TZ environment variable. Returns: The parsed TZ environment variable. Return type: TimezoneOffsetDetails
1.10.3. Classes¶
-
class
Calendar
(organizer_email, start, summary, organizer_cn=None, description=None, duration='1h', location=None)[source]¶ Bases:
icalendar.cal.Calendar
An icalendar formatted event for converting to an ICS file and then sending in an email.
-
__init__
(organizer_email, start, summary, organizer_cn=None, description=None, duration='1h', location=None)[source]¶ Parameters: - organizer_email (str) – The email of the event organizer.
- start (
datetime.datetime
) – The start time for the event. - summary (str) – A short summary of the event.
- organizer_cn (str) – The name of the event organizer.
- description (str) – A more complete description of the event than what is provided by the summary parameter.
- duration (int, str,
timedelta
,DurationAllDay
) – The events scheduled duration. - location (str) – The location for the event.
-
-
class
DurationAllDay
(days=1)[source]¶ Bases:
object
A representation of a duration that can be used for an event to indicate that it takes place all day.
-
class
Timezone
(tz_name=None)[source]¶ Bases:
icalendar.cal.Timezone
An icalendar formatted timezone with all properties populated for the specified zone.