Toloka documentation

find_assignments

toloka.client.TolokaClient.find_assignments

Finds all assignments that match certain rules

As a result, it returns an object that contains the first part of the found assignments and whether there are any more results. It is better to use the "get_assignments" method, they allow to iterate trought all results and not just the first output.

Parameters Description

Parameters Type Description
status Union[str, Assignment.Status, List[Union[str, Assignment.Status]], None]

Status of an assigned task suite (Detailed status description in Assignment.Status):

  • ACTIVE
  • SUBMITTED
  • ACCEPTED
  • REJECTED
  • SKIPPED
  • EXPIRED

task_id Optional[str]

The task ID in suites generated automatically using "smart mixing". You will get responses for task suites that contain the specified task.

task_suite_id Optional[str]

ID of a task suite.

pool_id Optional[str]

Pool ID.

user_id Optional[str]

Performer ID.

id_lt Optional[str]

Task suites with an assignment ID less than the specified value.

id_lte Optional[str]

Task suites with an assignment ID less than or equal to the specified value.

id_gt Optional[str]

Task suites with an assignment ID greater than the specified value.

id_gte Optional[str]

Task suites with an assignment ID greater than or equal to the specified value.

created_lt Optional[datetime]

Task suites assigned before the specified date.

created_lte Optional[datetime]

Task suites assigned before or on the specified date.

created_gt Optional[datetime]

Task suites assigned after the specified date.

created_gte Optional[datetime]

Task suites assigned after or on the specified date.

submitted_lt Optional[datetime]

Task suites completed before the specified date.

submitted_lte Optional[datetime]

Task suites completed before or on the specified date.

submitted_gt Optional[datetime]

Task suites completed after the specified date.

submitted_gte Optional[datetime]

Task suites completed after or on the specified date.

accepted_lt Optional[datetime]

Task suites accepted before the specified date.

accepted_lte Optional[datetime]

Task suites accepted before or on the specified date.

accepted_gt Optional[datetime]

Task suites accepted after the specified date.

accepted_gte Optional[datetime]

Task suites accepted after or on the specified date.

rejected_lt Optional[datetime]

Task suites rejected before the specified date.

rejected_lte Optional[datetime]

Task suites rejected before or on the specified date.

rejected_gt Optional[datetime]

Task suites rejected after the specified date.

rejected_gte Optional[datetime]

Task suites rejected after or on the specified date.

skipped_lt Optional[datetime]

Task suites skipped before the specified date.

skipped_lte Optional[datetime]

Task suites skipped before or on the specified date.

skipped_gt Optional[datetime]

Task suites skipped after the specified date.

skipped_gte Optional[datetime]

Task suites skipped after or on the specified date.

expired_lt Optional[datetime]

Task suites expired before the specified date.

expired_lte Optional[datetime]

Task suites expired before or on the specified date.

expired_gt Optional[datetime]

Task suites expired after the specified date.

expired_gte Optional[datetime]

Task suites expired after or on the specified date.

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

How to sort result. Defaults to None.

limit Optional[int]

Limit on the number of assignments returned. The maximum is 100,000. Defaults to None, in which case it returns first 50 results.

  • Returns:

    The first limit assignments in items. And a mark that there is more.

  • Return type:

    AssignmentSearchResult

Examples:

Search for SKIPPED or EXPIRED assignments in the specified pool.

toloka_client.find_assignments(pool_id='1', status = ['SKIPPED', 'EXPIRED'])

If method finds more objects than custom or system limit allows to operate, it will also show an indicator has_more=True.