icalendar.prop.empty module#

This is an 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 represents an invalid, empty property that is still there.

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, while ical_value raises so the broken state is 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 from RFC 6321.

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

Parameters:

xml (XCalParser | ElementAdapter | Element) – The XML to parse or a parser.

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#