Toloka documentation

get_attachments

toloka.client.TolokaClient.get_attachments

Finds all attachments that match certain rules and returns their metadata in an iterable object

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

Parameters Description

Parameters Type Description
name Optional[str]

File name.

type Optional[Attachment.Type]

Attachment type. Currently the key can have only one value - ASSIGNMENT_ATTACHMENT.

user_id Optional[str]

ID of the user who uploaded the file(s).

assignment_id Optional[str]

Assignment ID.

pool_id Optional[str]

Pool ID.

owner_id Optional[str]

Optional[str]

owner_company_id Optional[str]

Optional[str]

id_lt Optional[str]

Files with an ID less than the specified value.

id_lte Optional[str]

Files with an ID less than or equal to the specified value.

id_gt Optional[str]

Files with an ID greater than the specified value.

id_gte Optional[str]

Files with an ID greater than or equal to the specified value.

created_lt Optional[datetime]

Files uploaded by users before the specified date.

created_lte Optional[datetime]

Files uploaded by users before or on the specified date.

created_gt Optional[datetime]

Files uploaded by users after the specified date.

created_gte Optional[datetime]

Files uploaded by users after or on the specified date.

  • Yields:

    The next object corresponding to the request parameters.

  • Yield type:

    Generator[Attachment, None, None]

Examples:

Make a list of all received attachments in the specified pool.

results_list = [attachment for attachment in toloka_client.get_attachments(pool_id='1')]