icalendar.parser.ical.component module#
Parsing a component's iCalendar data.
- class icalendar.parser.ical.component.ComponentIcalParser(data, component_factory, types_factory)[source]#
Bases:
objectA parser for a component's iCalendar data.
This uses the template method pattern, where the main parsing logic can be refined in subclasses.
Initialize the parser with the raw data.
- Parameters:
data (
bytes|str|list[Contentline]) – The raw iCalendar data to parse, either as bytes or a list of content lines.component_factory (
ComponentFactory) – The factory to use for creating components.types_factory (
TypesFactory) – The factory to use for creating property values.
- contains_uid(uid)[source]#
Determines whether the component contains a
uid.- Return type:
- Returns:
Trueif the component contains auid, elseFalse.
- datetime_names: ClassVar[tuple[str, ...]] = ('DTSTART', 'DTEND', 'RECURRENCE-ID', 'DUE', 'RDATE', 'EXDATE')#
Names to check for TZID parameter when parsing datetimes.
Their
from_icalmethods take an optionaltzidargument, which is used if the property has a TZID parameter.
- get_factory_for_property(name, params)[source]#
Get the factory for a property.
- Return type:
vAdr|vBoolean|vBroken|vCalAddress|vCategory|vDDDLists|vDDDTypes|vDate|vDatetime|vDuration|vFloat|vFrequency|vInt|vMonth|vN|vOrg|vPeriod|vRecur|vSkip|vText|vTime|vUTCOffset|vUri|vWeekday|vInline|vBinary|vGeo|vUnknown|vXmlReference|vUid
- handle_categories(params, vals, line)[source]#
Handle the special case of CATEGORIES property.
- Return type:
- Returns:
Trueif handled, elseFalse.
- handle_property(name, params, vals, line)[source]#
Handle a property line.
Add properties to the top of the current stack.
- Parameters:
name (
str) – The name of the property, uppercased.params (
Parameters) – The parameters of the property.vals (
str) – The value of the property.line (
Contentline) – The original content line.
- Return type:
- handle_property_parse_error(exception, name, params, val, line)[source]#
Handle the parse error for a property.