ScriptFilter (autotransform.filter.script)

The implementation for script based Filters.

class autotransform.filter.script.ScriptFilter(*, inverted: bool = False, args: List[str], script: str, timeout: int, chunk_size: int | None = None)

Bases: BulkFilter

A Filter that uses a script to validate 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

chunk_size

The maximum number of items per run of the script. If None, then no chunking is used. Defaults to None.

Type:

Optional[int], optional

name

The name of the component.

Type:

ClassVar[FilterName]

args: List[str]
chunk_size: int | None
model_config: ClassVar[ConfigDict] = {}

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

model_post_init(context: Any, /) None

We need to both initialize private attributes and call the user-defined model_post_init method.

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