Tasks

TagmeClientAdvanced.archive_task(task_id: str, organization_id: str | None = None, ) → None

Archive task.

Parameters

* task_id – task id.

* organization_id – optional organization identifier.

TagmeClientAdvanced.assign_assignment(task_id: str, item_id: str, marker_id: str, expired_after: datetime, original_assignment_id: str | None = None, price: float | None = None, is_increase_overlap: bool | None = None, is_release_to_pool_on_expire: bool | None = None, organization_id: str | None = None, ) → None

Assign an assignment in item

Parameters

* task_id – id of task.

* item_id – id of item.

* marker_id – id of marker.

* expired_after – time of expiring of assignment.

* original_assignment_id – id of assignment for premarkup.

* price – price, if None, will be taken from task price.

* is_increase_overlap – if True, new assignment will be created.

* is_release_to_pool_on_expire – if True, new assignment won’t be created after expiring this one.

Returns

None.

TagmeClientAdvanced.check_task(task_id: str, organization_id: str | None = None, )CheckTaskResult

Check task settings before start.

Parameters

* task_id – task id.

* organization_id – optional organization identifier. Defaults to None.

Returns

current task settings.

TagmeClientAdvanced.complete_task(task_id: str, organization_id: str | None = None, )TaskData

Complete task.

Parameters

* task_id – task id.

* organization_id – optional organization identifier. Defaults to None.

Returns

task data.

TagmeClientAdvanced.create_and_start_task(config: ProjectConfig, project_id: str, task_name: str | None = None, start_task: bool = True, organization_id: str | None = None, )TaskData

(deprecated) Create task inside project and start it. Use separate methods instead.

Parameters

* config – data to create task.

* project_id – project id to add task.

* task_name – name of task to create. Defaults to None.

* start_task – start task after its creation. Defaults to True.

* organization_id – optional organization identifier. Defaults to None.

Returns

created task.

TagmeClientAdvanced.create_project_and_task(config: ProjectConfig, start_task: bool = True, organization_id: str | None = None, ) → Tuple[str, TaskData]

(deprecated) Create project and task for it. Use ‘create_task’ and ‘create_project’ or ‘create_project_by_config’ instead.

Parameters

* config – full project data.

* start_task – start task after its creation. Defaults to True.

* organization_id – optional organization identifier. Defaults to None.

Returns

project_id and created task.

TagmeClientAdvanced.create_task(task: TaskDataRequest | TaskData | dict, organization_id: str | None = None, )TaskData

Create new task.

Parameters

* task – new task’s data.

* organization_id – optional organization identifier. Defaults to None.

Returns

created task.

TagmeClientAdvanced.create_task_in_project(config: ProjectConfig, project_id: str, task_name: str | None = None, organization_id: str | None = None, )TaskData

(deprecated) Create task inside project. Use ‘create_task’ instead.

Parameters

* config – data to create task.

* project_id – project id to add task to.

* task_name – name of task to create. Defaults to None.

* organization_id – optional organization identifier. Defaults to None.

Returns

created task.

TagmeClientAdvanced.delete_task_payload(task_id: str, organization_id: str | None = None, ) → None

Delete payload from task.

Parameters

* task_id – task id to delete payload for.

* organization_id – optional organization identifier. Defaults to None.

TagmeClientAdvanced.duplicate_task(original_task: TaskData | dict, task: dict = None, organization_id: str | None = None, )TaskData

Create duplicate of task.

Parameters

* original_task – original task.

* task – new task data, different from the original task data.

* organization_id – optional organization identifier. Defaults to None.

Returns

created task.

TagmeClientAdvanced.get_task(task_id: str, organization_id: str | None = None, with_files_count: bool = False, )TaskData

Get task by id.

Parameters

* task_id – id of task to get.

* organization_id – optional organization identifier. Defaults to None.

Returns

task data.

TagmeClientAdvanced.get_task_files_count(task_id: str, types: List[str] | None = None, organization_id: str | None = None, )TaskFilesCount

Get count of files in task by types.

Parameters

* task_id – id of task.

* types – file types to include (all, control, study, data)

* organizaton_id – optional organization identifier. Defaults to None.

Returns

files count for requested types.

TagmeClientAdvanced.get_task_hierarchy(task_id: str, )TaskHierarchy

Get project id and organization id for task.

Parameters task_id – id of task.

Returns

Object which contains project_id and organization_id of task.

TagmeClientAdvanced.get_task_info(task_id: str, organization_id: str | None = None, ) → Dict

Get information about task bucket in cloud.

Parameters

* task_id – task id.

* organization_id – optional organization identifier. Defaults to None.

Returns

bucket information.

TagmeClientAdvanced.get_task_payload(task_id: str, organization_id: str | None = None, ) → dict

Get task payload.

Parameters

* task_id – task id to get payload for.

* organization_id – optional organization identifier. Defaults to None.

Returns

task payload.

TagmeClientAdvanced.get_tasks(project_id: str | None = None, price_min: float | None = None, price_max: float | None = None, priority_min: int | None = None, priority_max: int | None = None, query: str | None = None, page: int | None = None, size: int | None = None, organization_id: str | None = None, update_date_from: str | None = None, ) → List[TaskData]

Get tasks matching by filter.

Parameters

* project_id – optional project identifier.

* price_max – optional maximum price for task.

* price_min – optional minimum price for task.

* priority_min – optional minimum priority for task.

* priority_max – optional maximum priority for task.

* query – optional search query for task names.

* page – page number for pagination.

* size – number of items per page for pagination.

* organization_id – optional organization identifier. Defaults to None.

* update_date_from – optional update date for tasks.

Returns

list of tasks.

TagmeClientAdvanced.get_tasks_advanced(task_ids: Sequence[str] | None = None, project_ids: Sequence[str] | None = None, organization_id: str | None = None, with_empty: bool = True, with_payload: bool = False, with_project_pipeline: bool | dict = False, archived: bool | None = None, ) → List[TaskData]

Get tasks matching by filter.

Parameters

* task_ids – optional task identifiers. If not set, all tasks are returned.

* project_ids – optional project identifiers. If not set, tasks from all the projects are returned.

* organization_id – optional organization identifier. Defaults to None.

* with_empty – if set to True, tasks with no files are returned. Defaults to True.

* with_payload – if set to True, tasks payload is added. Defaults to False.

* with_project_config – add project config to tasks payload. Defaults to False.

* archived – if set to True or False, only archived or not archived tasks are returned. Defaults to None.

Returns

list of tasks.

TagmeClientAdvanced.increase_item_overlap(task_id: str, item_id: str, organization_id: str | None = None, )Item

Increase overlap of an item

Parameters

* task_id – id of task.

* item_id – id of item.

Returns

Item info.

TagmeClientAdvanced.load_task_payload(task: TaskData, ) → None

Add payload to task (to ‘payload’ field).

Parameters task – task to load payload for.

TagmeClientAdvanced.poll_for_task_state(task_id: str, state: TaskState, retry_amount: int = 15, wait_seconds: float = 3, organization_id: str | None = None, )TaskState

Wait while task has needed state.

Parameters

* task_id – task id.

* state – task state needed.

* retry_amount – amount of retries for polling. Defaults to 15.

* wait_seconds – amount of seconds for polling. Defaults to 3.

* organization_id – optional organization id. Defaults to None.

Returns

task state after finish of polling.

TagmeClientAdvanced.put_item_overlap(task_id: str, item_id: str, overlap: int, organization_id: str | None = None, )Item

Change overlap of an item

Parameters

* task_id – id of task.

* item_id – id of item.

* overlap – target overlap value

Returns

Item info.

TagmeClientAdvanced.remove_task(task_id: str, organization_id: str | None = None, ) → None

Remove task

Parameters

* task_id – task id.

* organization_id – optional organization identifier. Defaults to None.

TagmeClientAdvanced.set_task_payload(task_id: str, payload: dict, organization_id: str | None = None, ) → dict

Set task payload.

Parameters

* task_id – task id to set payload for.

* payload – payload to set.

* organization_id – optional organization identifier. Defaults to None.

Returns

new task payload.

TagmeClientAdvanced.start_task(task_id: str, organization_id: str | None = None, retry_amount: int = 15, wait_seconds: float = 3, )TaskData

Start task.

Parameters

* task_id – task id.

* organization_id – optional organization identifier. Defaults to None.

* retry_amount – number of retries of starting task. Defaults to 15.

* wait_seconds – seconds to wait between retries. Defaults to 3.

Returns

task data.

TagmeClientAdvanced.stop_task(task_id: str, organization_id: str | None = None, )TaskData

Stop task and wait for it to stop.

Parameters

* task_id – task id.

* organization_id – optional organization identifier. Defaults to None.

Returns

task data.

TagmeClientAdvanced.unarchive_task(task_id: str, organization_id: str | None = None, ) → None

Unarchive task.

Parameters

* task_id – task id.

* organization_id – optional organization identifier. Defaults to None.

TagmeClientAdvanced.unassign_assignment(task_id: str, assignment_id: str, is_keep_price: bool | None = None, is_decrease_overlap: bool | None = None, organization_id: str | None = None, ) → None

Unassign previously assigned assignment

Parameters

* task_id – id of task.

* assignment_id – id of assignment.

* is_keep_price – if True, price will be saved as a price of an unassigned assignment.

* is_decrease_overlap – if True, item overlap will decrement.

Returns

None.

TagmeClientAdvanced.update_task(task: TaskData | dict, organization_id: str | None = None, )TaskData

Update task.

Parameters

* task – new task’s data.

* organization_id – optional organization identifier. Defaults to None.

Returns

updated task.

TagmeClientAdvanced.upload_folder_pdf(task_id: str, folder: str | Path, cloud_client: Any | None = None, exclude_ext_filter: Set[str] | None = None, organization_id: str | None = None, tqdm_on: bool | str = False, )UploadFilesResult

Upload folder with pdf-files. Transforms pdf-files into png images before uploading.

Parameters

* task_id – task id to upload files to.

* folder – folder with pdf files.

* cloud_client – cloud client used to upload files.

* exclude_ext_filter – skip files of given extension. Defaults to None.

* organization_id – optional organization identifier. Defaults to None.

Returns

uploaded files and errors.