_MetadataMixin#

class _MetadataMixin(metadata: Optional[dict[str, Any]] = None)#

Methods

clear_metadata

Remove all properties.

property

Returns the value of a metadata property or None if it does not exist.

property_exists

Check if a given property is set.

set_property

Sets the value of a metadata property.

Attributes

metadata

Returns the collection's metadata.

Parameters

metadata (dict[str, Any] | None) --

Methods#

_MetadataMixin.clear_metadata() None#

Remove all properties.

Return type

None

_MetadataMixin.property(prop: str) Optional[Any]#

Returns the value of a metadata property or None if it does not exist.

Parameters

prop (str) -- the property to read

Return type

Optional[Any]

_MetadataMixin.property_exists(prop: str) bool#

Check if a given property is set.

Parameters

prop (str) -- the property whose existence to check

Return type

bool

_MetadataMixin.set_property(prop: str, value: Optional[Any]) None#

Sets the value of a metadata property. For system properties, this function casts the value to the proper type and throw an exception if this fails. If the value is None, the property is removed.

Parameters
  • prop (str) -- property to set

  • value (Optional[Any]) -- value to assign

Return type

None

Attributes#

_MetadataMixin.metadata#

Returns the collection’s metadata.

Returns

metadata