icalendar.prop.categories module#

CATEGORIES property values from RFC 5545.

class icalendar.prop.categories.vCategory(c_list, /, params=None)[source]#

Bases: object

default_value: ClassVar[str] = 'TEXT'#
classmethod examples()[source]#

Examples of vCategory.

Return type:

list[Self]

static from_ical(ical)[source]#

Parse a CATEGORIES value from iCalendar format.

This helper is normally called by Component.from_ical, which already splits the CATEGORIES property into a list of unescaped category strings. New code should therefore pass a list of strings.

Passing a single comma-separated string is supported only for backwards compatibility with older parsing code and is considered legacy behavior.

Parameters:

ical (list[str] | str) – A list of category strings (preferred, as provided by Component.from_ical), or a single comma-separated string from a legacy caller.

Return type:

list[str]

Returns:

A list of category strings.

classmethod from_jcal(jcal_property)[source]#

Parse jCal from RFC 7265.

Parameters:

jcal_property (list) – The jCal property to parse.

Raises:

JCalParsingError – If the provided jCal is invalid.

Return type:

Self

classmethod from_xcal(xml)[source]#

Parse xCal according to RFC 6321.

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: list[str]#

The list of categories as strings.

params: Parameters#
to_ical()[source]#
Return type:

bytes

to_jcal(name)[source]#

The jCal representation for categories.

Return type:

list

to_xcal(element)[source]#

Add the xCal representation of this property according to RFC 6321.

Return type:

None