get_trainings

toloka.client.TolokaClient.get_trainings | Source code

Finds all trainings that match certain criteria.

get_trainings returns a generator. You can iterate over all found trainings using the generator. Several requests to the Toloka server are possible while iterating.

If you need to sort trainings use the find_trainings method.

Parameters Description

ParametersTypeDescription
statusOptional[Training.Status]

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

project_idOptional[str]

Training pools belonging to the project with the specified ID.

id_ltOptional[str]

Training pools with IDs less than the specified value.

id_lteOptional[str]

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

id_gtOptional[str]

Training pools with IDs greater than the specified value.

id_gteOptional[str]

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

created_ltOptional[datetime]

Training pools created before the specified date.

created_lteOptional[datetime]

Training pools created before or on the specified date.

created_gtOptional[datetime]

Training pools created after the specified date.

created_gteOptional[datetime]

Training pools created after or on the specified date.

last_started_ltOptional[datetime]

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

last_started_lteOptional[datetime]

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

last_started_gtOptional[datetime]

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

last_started_gteOptional[datetime]

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

batch_sizeOptional[int]

Returned trainings limit for each request. The maximum allowed batch_size is 300.

  • Yields:

    The next matching training.

  • Yield type:

    Generator[Training, None, None]

Examples:

Getting all trainings in a project.

trainings = toloka_client.get_trainings(project_id='1')
Toloka-Kit
OverviewGetting OAuth tokenQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming