icalendar.attr.property_list module#

A list-like view for RFC 5545 Section 3.8 component property values.

class icalendar.attr.property_list.PropertyListView(component, name)[source]#

Bases: MutableSequence

A list-like view of an RFC 5545 Section 3.8 property within a component.

This view synchronizes modifications, such as append, extend, insert, clear, and delete, with the underlying component dictionary.

Initialize the property list view for a given component and property name.

Parameters:
  • component (Component) – The component to view.

  • name (str) – The name of the property to view.

clear()[source]#

Remove all values and the property from the component.

Return type:

None

copy()[source]#

Return a shallow copy of the property list as a regular list.

Return type:

list[Any]

insert(index, value)[source]#

Insert an item into the property list at a given index.

Parameters:
  • index (int) – The position at which to insert the item into the property list.

  • value (Any) – The value to insert in the property list at the given index.

Return type:

None

replace_with(values)[source]#

Replace all values in the property with values.

The values are added with Component.add, so they are converted to the correct types.

Parameters:

values (Any) – The values to replace in the property list. None removes all values from the property, whereas a single string value or any sequence type replaces all values in the property and is stored as a list.

Return type:

None