Tasks#

The Tasks class can be used to to create and manage tasks and list of tasks. Use the apsync.Api object to access a set up instance.

class apsync.Tasks#
copy_task(task: apsync.Task) apsync.Task#

Copies a task

Parameters

task (Task) – The task to copy

Example

>>> task = apsync.tasks.copy_task(task)
create_task(task_list: TaskList, name: str) Task#
create_task(target: str, task_list_name: str, name: str) Task

Helper for @overload to raise when called.

create_task_list(target: str, name: str) apsync.TaskList#

Creates a new empty list of tasks

Parameters
  • target (str) – The folder where the task list will be created

  • name (str) – The name of the task list

Example

>>> task_list = apsync.tasks.create_task_list("D:/Assets", "Todos")
get_task(task_list: apsync.TaskList, name: str) Optional[apsync.Task]#

Returns a task from a task list - or None

Parameters
  • task_list (TaskList) – The task list

  • name (str) – The name of the task

Example

>>> task = apsync.tasks.get_task(todo_list, "Create Rig")
get_task_by_id(id: str) apsync.Task#

Returns a task given its id

Parameters

id (str) – The id of the task

Example

>>> task = apsync.tasks.task_id(task_id)
get_task_list(target: str, name: str) Optional[apsync.TaskList]#

Returns the task list or None

Parameters
  • target (str) – The folder used to search for task lists

  • name (str) – The new name of the task list

Example

>>> todo_list = apsync.tasks.get_task_list("D:/Assets", "Todos")
get_task_list_by_id(id: str) apsync.TaskList#

Returns the task list

Parameters

id (str) – The id of the task list

Example

>>> todo_list = apsync.tasks.get_task_list_by_id(task_list_id)
get_task_lists(target: str) List[apsync.TaskList]#

Returns a list of all task lists in a given folder

Parameters

target (str) – The folder used to search for task lists

Example

>>> all_lists = apsync.tasks.get_task_lists("D:/Assets")
get_tasks(task_list: apsync.TaskList) List[apsync.Task]#

Returns a list of all tasks of a task list

Parameters

task_list (TaskList) – The task list

Example

>>> all_tasks = apsync.tasks.get_tasks(task_list)
remove_task(task: apsync.Task) None#

Removes a task. Cannot be undone.

Parameters

task (Task) – The task to remove

Example

>>> apsync.tasks.remove_task(task)
remove_task_list(task_list: apsync.TaskList) None#

Removes a task list and deletes all tasks. Cannot be undone

Parameters

task_list (TaskList) – The task list to remove

Example

>>> apsync.tasks.remove_task_list(task_list)
rename_task(task: apsync.Task, name: str) None#

Renames a task

Parameters
  • task (Task) – The task to rename

  • name (str) – The new name of the task

Example

>>> apsync.tasks.rename_task(task, "My Renamed Task")
rename_task_list(task_list: apsync.TaskList, name: str) None#

Renames a task list

Parameters
  • task_list (TaskList) – The task list that is renamed

  • name (str) – The new name of the task list

Example

>>> apsync.tasks.rename_task_list(task_list, "My Todos")
set_task_icon(task: apsync.Task, icon: Optional[apsync.Icon]) None#

Sets the Icon of a task. Set the icon to None to remove the icon

Parameters
  • task (Task) – The task

  • icon (Icon) – The icon to set

Example

>>> apsync.tasks.set_task_icon(task, icon)
set_task_icons(tasks: List[apsync.Task], icon: Optional[apsync.Icon]) None#

Sets the Icon for many tasks. Set the icon to None to remove the icon. This is faster than setting icons one by one

Parameters
  • tasks (list[Task]) – The list of tasks

  • icon (Icon) – The icon to set

Example

>>> apsync.tasks.set_task_icons(tasks, icon)
class apsync.Task#
property icon: Optional[apsync.Icon]#

typing.Optional[Icon]

Type

type

property id: str#

str

Type

type

property list_id: str#

str

Type

type

property name: str#

str

Type

type

property project_id: Optional[str]#

typing.Optional[str]

Type

type

property workspace_id: str#

str

Type

type

class apsync.TaskList#
property id: str#

str

Type

type

property name: str#

str

Type

type

property project_id: Optional[str]#

typing.Optional[str]

Type

type

property workspace_id: str#

str

Type

type