ReplaceHelperV1

toloka.client.project.template_builder.helpers.ReplaceHelperV1 | Source code

ReplaceHelperV1(
self,
data: Optional[Any] = None,
find: Optional[Union[BaseComponent, str]] = None,
replace: Optional[Union[BaseComponent, str]] = None,
*,
version: Optional[str] = '1.0.0'
)

Allows you to replace some parts of the string with others.

This helper function returns a string in which all occurrences of find in data are replaced with replace. Because the helper.replace helper returns a string, it can be used in properties that accept string values.

Parameters Description

ParametersTypeDescription
dataOptional[Any]

Data to perform the replacement on.

findOptional[Union[BaseComponent, str]]

The value to search for — the string whose occurrences must be found in data and replaced with the string from replace.

replaceOptional[Union[BaseComponent, str]]

The value to insert in place of the matches of the find value.

Toloka-Kit
OverviewGetting OAuth tokenQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming