icalendar.parser.xcal.component module#

A parser for components.

class icalendar.parser.xcal.component.XCalComponentParser(element, component_factory, types_factory)[source]#

Bases: XCalParser

A parser for components.

Parameters:

Examples

The element can be a an icalendar stream that contains one or more vcalendar components.

<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
  <vcalendar>
    ...
  </vcalendar>
</icalendar>

Components can contain other components inside the components tag. The parameter element can be such a components tag.

<components>
  <vevent>
    ...
  </vevent>
</components>
parse_component()[source]#

Convert one child into a Component.

Return type:

Component

Returns:

The parsed component.

Raises:

Example

The XML below shows the structure of one component element that gets parsed by this method. vcalendar is the name of the component. Each component can contain a properties and a components element with more components.

<vcalendar>
  <properties>
    ...
  </properties>
  <components>
    <vevent>
    ...
    </vevent>
  </components>
</vcalendar>
parse_component_from_child()[source]#

Parse a component from a child element.

Return type:

Component

Returns:

The parsed component.

Raises: