find_trainings
toloka.client.TolokaClient.find_trainings
Finds all trainings that match certain rules
As a result, it returns an object that contains the first part of the found trainings and whether there are any more results. It is better to use the "get_trainings" method, they allow to iterate trought all results and not just the first output.
Parameters Description
Parameters | Type | Description |
---|---|---|
status |
Optional[Training.Status] | Training pool status:
|
project_id |
Optional[str] | ID of the project to which the training pool is attached. |
id_lt |
Optional[str] | Training pools with an ID less than the specified value. |
id_lte |
Optional[str] | Training pools with an ID less than or equal to the specified value. |
id_gt |
Optional[str] | Training pools with an ID greater than the specified value. |
id_gte |
Optional[str] | Training pools with an ID 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 last opened before the specified date. |
last_started_lte |
Optional[datetime] | Training pools that were last opened on or before the specified date. |
last_started_gt |
Optional[datetime] | Training pools that were last opened after the specified date. |
last_started_gte |
Optional[datetime] | Training pools that were last opened on or after the specified date. |
sort |
Union[List[str], TrainingSortItems, None] | How to sort result. Defaults to None. |
limit |
Optional[int] | Limit on the number of results returned. |
-
Returns:
The first
limit
trainings initems
. And a mark that there is more. -
Return type:
Examples:
Find all trainings in all projects.
toloka_client.find_trainings()
Find all open trainings in all projects.
toloka_client.find_trainings(status='OPEN')
Find all open trainings in a specific project.
toloka_client.find_trainings(status='OPEN', project_id='1')
If method finds more objects than custom or system limit
allows to operate, it will also show an indicator has_more=True
.