get_app_batches

toloka.client.TolokaClient.get_app_batches | Source code

Finds all batches that match certain criteria in an App project.

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

If you need to sort batches use the find_app_batches method.

Parameters description

ParametersTypeDescription
app_project_idstr

The ID of the App project.

after_idOptional[str]

The ID of the batch used for cursor pagination.

statusOptional[AppBatch.Status]

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

id_gtOptional[str]

Batches with IDs greater than the specified value.

id_gteOptional[str]

Batches with IDs greater than or equal to the specified value.

id_ltOptional[str]

Batches with IDs less than the specified value.

id_lteOptional[str]

Batches with IDs less than or equal to the specified value.

name_gtOptional[str]

Batches with names lexicographically greater than the specified value.

name_gteOptional[str]

Batches with names lexicographically greater than or equal to the specified value.

name_ltOptional[str]

Batches with names lexicographically less than the specified value.

name_lteOptional[str]

Batches with names lexicographically less than or equal to the specified value.

created_gtOptional[datetime]

Batches created after the specified date.

created_gteOptional[datetime]

Batches created after or on the specified date.

created_ltOptional[datetime]

Batches created before the specified date.

created_lteOptional[datetime]

Batches created before or on the specified date.

batch_sizeOptional[int]

A limit of items returned by each request to Toloka. The maximum allowed value: 1000.

  • Yields:

    The next matching batch.

  • Yield type:

    Generator[AppBatch, None, None]

Examples:

batches = toloka_client.get_app_batches(
app_project_id='Q2d15QBjpwWuDz8Z321g', status='NEW'
)
for batch in batches:
print(batch.id, batch.status, batch.items_count)

Last updated: August 28, 2023

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