icalendar.attr module#
Attributes of Components and properties.
- icalendar.attr.create_single_property(prop, value_attr, value_type, type_def, doc, vProp=<class 'icalendar.prop.vDDDTypes'>)[source]#
Create a single property getter and setter.
- icalendar.attr.get_duration_property(component)[source]#
Get the duration property with fallback calculation from start and end.
- icalendar.attr.get_end_property(component, end_property)[source]#
Get the end property with fallback logic for
EventandTodocomponents.- Parameters:
- Return type:
- Returns:
The computed end value.
- Raises:
IncompleteComponent – If the provided information is incomplete to compute the end property.
- icalendar.attr.get_start_end_duration_with_validation(component, start_property, end_property, component_name)[source]#
Validate the component and return start, end, and duration.
This tests validity according to RFC 5545 rules for
EventandTodocomponents.- Parameters:
- Returns:
(start, end, duration) values from the component.
- Return type:
- Raises:
InvalidCalendar – If the component violates RFC 5545 constraints.
- icalendar.attr.get_start_property(component)[source]#
Get the start property with validation.
- Parameters:
component (
Component) – The component from which to get its start property.- Return type:
- Returns:
The
DTSTARTvalue.- Raises:
IncompleteComponent – If no
DTSTARTis present.
- icalendar.attr.multi_language_text_property(main_prop, compatibility_prop, doc)[source]#
This creates a text property.
This property can be defined several times with different
LANGUAGEparameters.
- icalendar.attr.multi_string_property(name, doc)[source]#
A property for an iCalendar Property that can occur multiple times.
- icalendar.attr.set_duration_with_locking(component, duration, locked, end_property)[source]#
Set the duration with explicit locking behavior for
EventandTodo.- Parameters:
component (
Component) – The component to modify, eitherEventorTodo.duration (
timedelta|None) – The duration to set, orNoneto convert toDURATIONproperty.locked (
Literal['start','end']) – Which property to keep unchanged, eitherstartorend.end_property (
str) – The end property name, eitherDTENDforEventorDUEforTodo.
- Return type:
- icalendar.attr.set_end_with_locking(component, end, locked, end_property)[source]#
Set the end with explicit locking behavior for Event and Todo components.
- Parameters:
- Return type:
- icalendar.attr.set_start_with_locking(component, start, locked, end_property)[source]#
Set the start with explicit locking behavior for
EventandTodocomponents.- Parameters:
- Return type: