Property base class
All Properties are extending the Property class. Let's first start with the base class and then list all the other properties.
Property
Bases: ICalBaseClass
This is the base class for any property (according to the RFC 5545 specification) in iCal-library.
A property always exists of three parts:
- The name of the property.
- The property parameters, this is optional and does not need to be present.
- The value of the property.
A line containing a property typically has the following format:
PROPERTY-NAME;parameterKey=parameterValue,anotherParameterKey=anotherValue:actual-value
Any property that is predefined according to the RFC 5545 should inherit this class, e.g. UID, RRule. Only x-properties or iana-properties should instantiate the Property class directly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
Optional[str]
|
The value of the property. |
required |
name |
Optional[str]
|
The properties name, e.g. |
None
|
property_parameters |
Optional[str]
|
The property parameters for this definition. |
None
|
parent |
Component
|
Instance of the :class: |
None
|
Source code in ical_library/base_classes/property.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 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 68 69 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 112 113 114 115 |
|
as_original_string: str
property
Return the iCalendar representation of the parameter.
Returns:
Type | Description |
---|---|
the iCalendar string representation. |
property_parameters: Dict[str, str]
property
Return (and cache) all the property's parameters as a dictionary of strings.
Note: When the instance is collected by the garbage collection, the cache is automatically deleted as well.
Returns:
Type | Description |
---|---|
all the property's parameters as a dictionary of strings |
value: Optional[str]
property
Return the value of this property.
get_property_parameter(key)
Get a property parameter's value with a specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The identifier of the property parameter. |
required |
Returns:
Type | Description |
---|---|
Optional[str]
|
The requested property parameter, or if that is not present, the default value. |
Source code in ical_library/base_classes/property.py
84 85 86 87 88 89 90 91 |
|
get_property_parameter_default(key, default)
Get a property parameter's value with a specific key, where the default may not be None.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The identifier of the property parameter. |
required |
default |
str
|
A value to return when the property parameter is not present, which may not be None. |
required |
Returns:
Type | Description |
---|---|
str
|
The requested property parameter, or if that is not present, the default value. |
Source code in ical_library/base_classes/property.py
93 94 95 96 97 98 99 100 101 |
|
has_property_parameter(key)
Return whether this property has a property parameter with a specific key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
What key to search for. |
required |
Returns:
Type | Description |
---|---|
Optional[bool]
|
boolean whether this property has a property parameter with a specific key. |
Source code in ical_library/base_classes/property.py
75 76 77 78 79 80 81 82 |
|