icalendar.prop.empty module#

This is a value type for an empty iCalendar property.

The calendar is invalid. This eases round trip and corrections.

class icalendar.prop.empty.vEmpty(params=None)[source]#

Bases: vUnknown

This class represents an invalid, empty property to preserve parameters during a round trip.

This is used when a property element is present but carries no typed value, only parameters. Storing this placeholder keeps the parameters from being silently dropped when parsing. ical_value raises to make the broken state visible.

Properties containing vEmpty are invalid. However, they will be serialized correctly, repairing the calendar.

Examples

>>> from icalendar import Calendar
>>> cal = Calendar.from_xcal(
... b'''
... <icalendar>
...   <vcalendar>
...     <properties>
...       <version>
...         <parameters>
...           <x-param><text>x-content</text></x-param>
...         </parameters>
...         <!-- missing a value here -->
...       </version>
...     </properties>
...   </vcalendar>
... </icalendar>
... '''
... )[0]
>>> cal["VERSION"]
vEmpty()
>>> cal["VERSION"].params["x-param"]
'x-content'
encoding#
classmethod from_xcal(xml)[source]#

Parse xCal according to RFC 6321.

This does not parse any element, but instead assumes that there is no element.

Parameters:
  • parser – Required. The xCal to parse or a parser.

  • params – Required. The parameters of the xCal element.

Raises:

XCalParsingError – If the provided xCal is invalid.

Return type:

VProp

property ical_value: str#

This property is empty and has no value.

Raises:

InvalidCalendar – Always.

params: Parameters#