ScriptInput (autotransform.input.script)

The implementation for script based Inputs.

class autotransform.input.script.ScriptInput(*, args: List[str], script: str, timeout: int)

Bases: Input

An Input that uses a script to generate a list of Items.

args

The arguments to supply to the script.

Type:

List[str]

script

The script to run.

Type:

str

timeout

The timeout to use for the script process.

Type:

int

name

The name of the component.

Type:

ClassVar[InputName]

args: List[str]
get_items() Sequence[Item]

Uses a simple script to generate a list of Items. If a <<RESULT_FILE>> arg is used it will be replaced with the path of a temporary file that can be used to store a JSON encoded list of Items that will be returned. If no such arg is used, the STDOUT of the script will be interpreted as a JSON encoded list of Items.

Returns:

The supplied Items.

Return type:

Sequence[Item]

model_config: ClassVar[ConfigDict] = {}

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

name: ClassVar[InputName] = 'script'
script: str
timeout: int