MetadataContextHandlerMixin#

class tollan.pipeline.MetadataContextHandlerMixin[source]#

Bases: DictContextHandlerMixin, Generic

A helper class to access context stored in metadata dict.

Methods Summary

get_context_dict(data)

Get metadata dictionary storing contexts.

Methods Documentation

classmethod get_context_dict(data: Any) dict[KeyT, ContextT][source]#

Get metadata dictionary storing contexts.

Parameters:

data (Any) – Data object with .meta attribute

Returns:

Metadata dictionary containing contexts

Return type:

dict[KeyT, ContextT]

Raises:

ValueError – If data object has no .meta attribute