Toloka documentation

get_assignments

toloka.client.TolokaClient.get_assignments

Finds all assignments that match certain rules and returns them in an iterable object

Unlike find_assignments, returns generator. Does not sort assignments. While iterating over the result, several requests to the Toloka server is possible.

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.

  • Yields:

    The next object corresponding to the request parameters.

  • Yield type:

    Generator[Assignment, None, None]

Examples:

Let’s make a list of assignment_id of all SUBMITTED assignments in the specified pool.

from toloka.client import Assignment
assignments = toloka_client.get_assignments(pool_id='1', status=Assignment.SUBMITTED)
result_list = [assignment.id for assignment in assignments]