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
- 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.
1.10.3. Classes
- class Calendar(organizer_email, start, summary, organizer_cn=None, description=None, duration='1h', location=None)[source]
Bases:
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:
Timezone
An icalendar formatted timezone with all properties populated for the specified zone.