Batcher (autotransform.batcher.base)

The base class and associated classes for Batcher components.

class autotransform.batcher.base.Batch

Bases: TypedDict

A logical grouping of Items with title and associated metadata.

metadata: NotRequired[Mapping[str, Any]]
title: str
class autotransform.batcher.base.Batcher

Bases: NamedComponent

The base for Batcher components. Used by AutoTransform to separate Items in to logical groupings that can be acted on indepently and have associated metadata.

name

The name of the Component.

Type:

ClassVar[BatcherName]

abstract batch(items: Sequence[Item]) List[Batch]

Take filtered Items and separate in to logical groupings with associated group metadata and title.

Parameters:

items (Sequence[Item]) – The filtered Items to separate.

Returns:

A list of logical groupings of Items with associated group metadata and

title.

Return type:

List[Batch]

name: ClassVar[BatcherName]
class autotransform.batcher.base.BatcherName(value)

Bases: str, Enum

A simple enum for mapping.

CHUNK = 'chunk'
CODEOWNERS = 'codeowners'
DIRECTORY = 'directory'
EXTRA_DATA = 'extra_data'
FILE_REGEX = 'file_regex'
SINGLE = 'single'