Help classes
Sometimes properties have a lot in common. Instead of constantly redefining all methods, we simply create an abstraction from the properties which we call help classes.
This is the list of all help classes.
_IntProperty
Bases: Property
This property class should be inherited. It represents a property that contain just an int as value.
Source code in ical_library/ical_properties/ints.py
4 5 6 7 8 9 10 |
|
int_value: int
property
Return the value as an int.
_DTBoth
Bases: Property
This property class should be inherited. It represents a property that contain a datetime or date as value.
Source code in ical_library/ical_properties/dt.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
datetime_or_date_value: Union[Date, DateTime]
property
Return the value as a DateTime or Date value taking into account the optional TZID property parameter.
get_datetime_or_date_value_in_specific_tz(tz)
Return the value as a DateTime or Date value in a specific timezone.
Source code in ical_library/ical_properties/dt.py
28 29 30 31 32 33 34 35 36 |
|
_DTSingular
Bases: Property
This property class should be inherited. It represents a property that can only contain a datetime as value.
Source code in ical_library/ical_properties/dt.py
39 40 41 42 43 44 45 46 47 48 49 |
|
datetime: DateTime
property
Return the value as a DateTime value taking into account the optional TZID property parameter.
_CalAddress
Bases: Property
Source code in ical_library/ical_properties/cal_address.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
cu_type: str
property
Return the CUTYPE.
email: Optional[str]
property
Return the email if the value starts with mailto:
. Otherwise return None.
member: Optional[str]
property
Return the membership property parameter.
participation_status: str
property
Return the participation status, indicating whether the person will be present or not.
persons_name: Optional[str]
property
Return the persons name, identified by the CN property parameter.
role: str
property
Return the role of the person.
_PeriodFunctionality
Bases: Property
Provide methods to help to parse duration values.
This class should be inherited by a Property.
Source code in ical_library/ical_properties/periods.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
_parse_individual_datetime_or_duration_str(datetime_or_duration_str)
Parse an individual datetime or duration string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
datetime_or_duration_str |
str
|
A string represent either a datetime or duration. |
required |
Returns:
Type | Description |
---|---|
Union[DateTime, Duration]
|
A pendulum.DateTime if the string represented a datetime. Return a pendulum.Duration otherwise. |
Source code in ical_library/ical_properties/periods.py
39 40 41 42 43 44 45 46 47 |
|
_parse_individual_duration_str(period_str)
Parse an individual period represented by DateTime/DateTime or DateTime/Duration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
period_str |
str
|
The period to parse. Examples: 19960403T020000Z/19960403T040000Z or 19960404T010000Z/PT3H |
required |
Returns:
Type | Description |
---|---|
Tuple[DateTime, DateTime]
|
A tuple containing two DateTimes representing the start and end of the duration respectively. |
Source code in ical_library/ical_properties/periods.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
_parse_period_values()
Parse multiple values, delimited by comma's, representing periods.
Example value for self.value: 19960403T020000Z/19960403T040000Z,19960404T010000Z/PT3H
Returns:
Type | Description |
---|---|
List[Tuple[DateTime, DateTime]]
|
List of tuples containing two DateTimes representing the start and end of the duration respectively. |
Source code in ical_library/ical_properties/periods.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
_ExOrRDate
Bases: _PeriodFunctionality
Provide methods to help to parse different kind of values a Property could find.
This class should be inherited by a Property.
Source code in ical_library/ical_properties/periods.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
_parse_date_values()
Parse Date values. Example of a possible value of self.value: 19970101,19970120,19970217
Returns:
Type | Description |
---|---|
List[Date]
|
A list of pendulum.Date representing the start of an event/component. |
Source code in ical_library/ical_properties/periods.py
91 92 93 94 95 96 97 98 99 100 101 102 |
|
_parse_datetime_values()
Parses DateTime values. Example of a possible value of self.value: 19970714T123000Z,19970714T123300Z
Returns:
Type | Description |
---|---|
List[DateTime]
|
A List of DateTimes representing the start of an event/component. |
Source code in ical_library/ical_properties/periods.py
77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
_parse_individual_date_str(date)
staticmethod
Parse an individual date string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
date |
str
|
A string representing a date. |
required |
Returns:
Type | Description |
---|---|
Date
|
A pendulum.Date. |
Source code in ical_library/ical_properties/periods.py
104 105 106 107 108 109 110 111 |
|
_TZOffset
Bases: Property
Helper class to represent a UTC offset. This class should be inherited.
Add functions to parse the value as a fixed timezone offset.
Source code in ical_library/ical_properties/tz_offset.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
as_timezone_object()
Return the value of the property as a fixed timezone offset.
Source code in ical_library/ical_properties/tz_offset.py
22 23 24 |
|
parse_value_as_seconds()
Parse the value as seconds difference from UTC.
Source code in ical_library/ical_properties/tz_offset.py
13 14 15 16 17 18 19 20 |
|