Toloka documentation

find_trainings

toloka.client.TolokaClient.find_trainings | Source code

Finds training pools that match certain criteria.

The number of returned pools is limited. To find remaining pools call find_trainings with updated search criteria.

To iterate over all matching training pools you may use the get_trainings method.

Parameters Description

Parameters Type Description
status Optional[Training.Status]

Training pool status. Refer to the Training.Status page for more information on the available status values.

project_id Optional[str]

Training pools belonging to the project with the specified ID.

id_lt Optional[str]

Training pools with IDs less than the specified value.

id_lte Optional[str]

Training pools with IDs less than or equal to the specified value.

id_gt Optional[str]

Training pools with IDs greater than the specified value.

id_gte Optional[str]

Training pools with IDs greater than or equal to the specified value.

created_lt Optional[datetime]

Training pools created before the specified date.

created_lte Optional[datetime]

Training pools created before or on the specified date.

created_gt Optional[datetime]

Training pools created after the specified date.

created_gte Optional[datetime]

Training pools created after or on the specified date.

last_started_lt Optional[datetime]

Training pools that were opened last time before the specified date.

last_started_lte Optional[datetime]

Training pools that were opened last time before or on the specified date.

last_started_gt Optional[datetime]

Training pools that were opened last time after the specified date.

last_started_gte Optional[datetime]

Training pools that were opened last time after or on the specified date.

sort Union[List[str], TrainingSortItems, None]

Sorting options. Default: None.

limit Optional[int]

Returned training pools limit. The maximum allowed limit is 300.

  • Returns:

    Found training pools and a flag showing whether there are more matching pools exceeding the limit.

  • Return type:

    TrainingSearchResult

Examples:

Find all training pools in all projects.

pools = toloka_client.find_trainings()

Find all open training pools in all projects.

pools = toloka_client.find_trainings(status='OPEN')

Find all open training pools in a specific project.

pools = toloka_client.find_trainings(status='OPEN', project_id='1')

If there are pools exceeding the limit, then pools.has_more is set to True.