TargetInput (autotransform.input.target)

The implementation for the TargetInput.

class autotransform.input.target.TargetInput(*, input: Input, pattern: str, replacement: str)

Bases: Input

An Input that attaches a target_path to the Items returned by another Input’s FileItems. These target_paths are used to alter where written content is sent to.

input

The base Input used to generate Items.

Type:

Input

pattern

The pattern to use for regex replacement of the Item’s original path.

Type:

str

replacement

The replacement used by regex to create the target path.

Type:

str

name

The name of the component.

Type:

ClassVar[InputName]

classmethod from_data(data: Dict[str, Any]) TargetInput

Produces an instance of the component from decoded data.

Parameters:

data (Mapping[str, Any]) – The JSON decoded data.

Returns:

An instance of the component.

Return type:

TargetInput

get_items() Sequence[FileItem]

Gets a list of files recursively contained within the path.

Returns:

The eligible files for transformation.

Return type:

Sequence[FileItem]

input: Input
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: ClassVar[InputName] = 'target'
pattern: str
replacement: str