icalendar.parser.xcal.parameters module#

class icalendar.parser.xcal.parameters.XCalParameterParser(element, types_factory=None)[source]#

Bases: XCalParser

A parser for one parameter.

parse_parameter()[source]#

Parse one parameter value if present.

Return type:

str

Returns:

The parsed parameters.

Example:

<tzid>
    <text>US/Eastern</text>
</tzid>
class icalendar.parser.xcal.parameters.XCalParametersParser(element, types_factory=None)[source]#

Bases: XCalParser

A parser for <parameters>.

Parameters:
  • element (Element | ElementAdapter) – The xCal element to parse.

  • types_factory (TypesFactory | None) – The types factory to use. If None is passed, the default TypesFactory is used.

Example

The parameter element can be a parameters tag as shown below:

<parameters>
    <tzid>
        <text>US/Eastern</text>
    </tzid>
</parameters>
parse_parameter()[source]#

Parse the next parameter that has not been parsed, yet.

This function only parses one parameter inside the parser's element parameter and adds it to the collected parameters. Each call parses a single parameter.

Raises:
Return type:

None

Example

The example below shows a parameters tag with a tzid parameter. This function would only parse the tzid parameter.

<parameters>
    <tzid>
        <text>US/Eastern</text>
    </tzid>
</parameters>
parse_parameters()[source]#

Parse all parameters until finished.

Parameters are parsed once and are the same for all property values inside a property tag. This method parses the whole parameters tag collects them and returns them as a Parameters object.

Return type:

Parameters

Returns:

The parsed parameters.

Raises:

XCalParsingError – If the provided xCal is invalid.