Component#
This is the ICalComponent instance.
Constructors#
- class Component
- classmethod new(kind: ComponentKind) Component#
Creates a new
Componentwith specific type.Added in version 1.0.
- Parameters:
kind – The
ComponentKind
- classmethod new_from_string(str: str) Component#
Creates a new
Componentbased on a string.Added in version 1.0.
- Parameters:
str – The string used to create
Component
- classmethod new_vagenda() Component#
Creates a
Componentwith the type to be vagenda.Added in version 1.0.
- classmethod new_valarm() Component#
Creates a
Componentwith the type to be valarm.Added in version 1.0.
- classmethod new_vavailability() Component#
Creates a
Componentwith the type to be vavailability.Added in version 1.0.
- classmethod new_vcalendar() Component#
Creates a
Componentwith the type to be vcalendar.Added in version 1.0.
- classmethod new_vevent() Component#
Creates a
Componentwith the type to be vevent.Added in version 1.0.
- classmethod new_vfreebusy() Component#
Creates a
Componentwith the type to be vfreebusy.Added in version 1.0.
- classmethod new_vjournal() Component#
Creates a
Componentwith the type to be vjournal.Added in version 1.0.
- classmethod new_vpoll() Component#
Creates a
Componentwith the type to be vpoll.Added in version 1.0.
- classmethod new_vquery() Component#
Creates a
Componentwith the type to be vquery.Added in version 1.0.
- classmethod new_vtimezone() Component#
Creates a
Componentwith the type to be vtimezone.Added in version 1.0.
- classmethod new_vtodo() Component#
Creates a
Componentwith the type to be vtodo.Added in version 1.0.
- classmethod new_vvoter() Component#
Creates a
Componentwith the type to be vvoter.Added in version 1.0.
- classmethod new_x(x_name: str) Component#
Creates a new
Componentbased on name of x property.Added in version 1.0.
- Parameters:
x_name – The name of x property
- classmethod new_xavailable() Component#
Creates a
Componentwith the type to be xavailable.Added in version 1.0.
- classmethod new_xdaylight() Component#
Creates a
Componentwith the type to be xdaylight.Added in version 1.0.
Methods#
- class Component
- add_component(child: Component) None#
Adds a
Componentinto anotherComponentas a child component.Added in version 1.0.
- Parameters:
child – A child
Component
- add_property(property: Property) None#
Adds an
PropertyintoComponent.Added in version 1.0.
- Parameters:
property – An
Property
- begin_component(kind: ComponentKind) CompIter#
Gets the
CompIterpointing to the first childComponent.Added in version 1.0.
- Parameters:
kind – A
ComponentKind
- convert_errors() None#
Converts some X-LIC-ERROR properties into RETURN-STATUS properties.
Added in version 1.0.
- count_components(kind: ComponentKind) int#
Counts the child
Componentwith the target kind in the parent one.Added in version 1.0.
- Parameters:
kind – The target
ComponentKind
- count_properties(kind: PropertyKind) int#
Counts the number of
PropertyinComponent.Added in version 1.0.
- Parameters:
kind – A
PropertyKind
- end_component(kind: ComponentKind) CompIter#
Gets the
CompIterpointing to the end childComponent.Added in version 1.0.
- Parameters:
kind – A
ComponentKind
- foreach_recurrence(start: Time, end: Time, callback: Callable[[Component, TimeSpan, Any], None], user_data: Any = None) None#
Cycles through all recurrences of an event. This function will call the specified callback function for once for the base value of DTSTART, and foreach recurring date/time value. It will filter out events that are specified as an EXDATE or an EXRULE.
Added in version 3.0.5.
- Parameters:
start – Ignore timespans before this
end – Ignore timespans after this
callback – Function called for each timespan within the range
user_data – The user data for callback function
- foreach_tzid(callback: Callable[[Parameter, Any], None], user_data: Any = None) None#
Applies the same manipulation on every tzid in
Component.Added in version 3.0.5.
- Parameters:
callback – The callback function
user_data – The data for callback function
- get_first_component(kind: ComponentKind) Component | None#
Gets the first
Componentwith specific kind inComponent.Added in version 1.0.
- Parameters:
kind – A
ComponentKind
- get_first_property(kind: PropertyKind) Property | None#
Gets the first
Propertywith specific kind inComponent.Added in version 1.0.
- Parameters:
kind – A
PropertyKind
- get_first_real_component() Component#
For VCOMPONENT: Returns a reference to the first VEVENT, VTODO or VJOURNAL.
Added in version 1.0.
- get_inner() Component | None#
Returns the first VEVENT, VTODO or VJOURNAL sub-component of cop, or comp if it is one of those types.
Added in version 1.0.
- get_method() PropertyMethod#
Gets the method of the
Component.Added in version 1.0.
- get_next_component(kind: ComponentKind) Component | None#
Gets the next
Componentwith specific kind inComponent.Added in version 1.0.
- Parameters:
kind – A
ComponentKind
- get_next_property(kind: PropertyKind) Property | None#
Gets the next
Propertywith specific kind inComponent.Added in version 1.0.
- Parameters:
kind – A
PropertyKind
- get_span() TimeSpan#
For VEVENT, VTODO, VJOURNAL and VTIMEZONE: reports the start and end times of an event in UTC.
Added in version 1.0.
- get_status() PropertyStatus#
Gets the status of the
Component.Added in version 1.0.
- get_timezone(tzid: str) Timezone | None#
Returns the icaltimezone in the component corresponding to the TZID, or NULL if it can’t be found.
Added in version 1.0.
- Parameters:
tzid – A string representing timezone
- isa() ComponentKind#
Gets the type of
Component.Added in version 1.0.
- isa_component() int#
Checks whether the native part of
Componentis icalcomponent.Added in version 1.0.
- classmethod kind_from_string() ComponentKind#
Converts a string to a
ComponentKind.Added in version 1.0.
- classmethod kind_is_valid() bool#
Checks if a
ComponentKindis valid.Added in version 1.0.
- classmethod kind_to_string() str#
Converts a
ComponentKindto a string.Added in version 1.0.
- merge_component(comp_to_merge: Component) None#
Takes 2 VCALENDAR components and merges the second one into the first, resolving any problems with conflicting TZIDs. comp_to_merge will no longer exist after calling this function.
Added in version 1.0.
- Parameters:
comp_to_merge – A
Component. After merged it will not exist any more.
- remove_component(child: Component) None#
Removes a child
Componentfrom anotherComponent.Added in version 1.0.
- Parameters:
child – A child
Component
- remove_property(property: Property) None#
Removes
PropertyfromComponent. Caution: The compare is based on address. So you must use the originalPropertyas the target.Added in version 1.0.
- Parameters:
property – A
Property
- set_comment(v: str) None#
Sets the comment of the
Component.Added in version 1.0.
- Parameters:
v – A string representing comment
- set_description(v: str) None#
Sets the description of the
Component.Added in version 1.0.
- Parameters:
v – A string representing description
- set_dtend(v: Time) None#
Sets the dtend of the
Component.Added in version 1.0.
- Parameters:
v – A
Time
- set_dtstamp(v: Time) None#
Sets the dtstamp of the
Component.Added in version 1.0.
- Parameters:
v – A
Time
- set_dtstart(v: Time) None#
Sets the dtstart of the
Component.Added in version 1.0.
- Parameters:
v – A
Time
- set_duration(v: Duration) None#
Sets the duration of the
Component.Added in version 1.0.
- Parameters:
v – A
Duration
- set_location(v: str) None#
Sets the location of the
Component.Added in version 1.0.
- Parameters:
v – A string representing location
- set_method(method: PropertyMethod) None#
Sets the method of the
Component.Added in version 1.0.
- Parameters:
method – A
PropertyMethod
- set_parent(parent: Component | None = None) None#
Sets the
parentComponentof the specifiedcomponent.Added in version 3.0.
- Parameters:
parent – An
Component, a new parent
- set_recurrenceid(v: Time) None#
Sets the recurrenceid of the
Component.Added in version 1.0.
- Parameters:
v – A
Time
- set_relcalid(v: str) None#
Sets the relcalid of the
Component.Added in version 1.0.
- Parameters:
v – A string representing relcalid
- set_sequence(v: int) None#
Sets the sequence of the
Component.Added in version 1.0.
- Parameters:
v – The sequence number
- set_status(status: PropertyStatus) None#
Sets the status of the
Component.Added in version 1.0.
- Parameters:
status – A
PropertyStatus
- set_summary(v: str) None#
Sets the summary of the
Component.Added in version 1.0.
- Parameters:
v – A string representing summary