airflow.providers.asana.hooks.asana

Connect to Asana.

Module Contents

Classes

AsanaHook

Wrapper around Asana Python client library.

class airflow.providers.asana.hooks.asana.AsanaHook(conn_id=default_conn_name, *args, **kwargs)[source]

Bases: airflow.hooks.base.BaseHook

Wrapper around Asana Python client library.

conn_name_attr = 'asana_conn_id'[source]
default_conn_name = 'asana_default'[source]
conn_type = 'asana'[source]
hook_name = 'Asana'[source]
get_conn()[source]

Return connection for the hook.

classmethod get_connection_form_widgets()[source]

Return connection widgets to add to connection form.

classmethod get_ui_field_behaviour()[source]

Return custom field behaviour.

client()[source]

Instantiate python-asana Client.

create_task(task_name, params)[source]

Create an Asana task.

Parameters
Returns

A dict of attributes of the created task, including its gid

Return type

dict

delete_task(task_id)[source]

Delete an Asana task.

Parameters

task_id (str) – Asana GID of the task to delete

Returns

A dict containing the response from Asana

Return type

dict

find_task(params)[source]

Retrieve a list of Asana tasks that match search parameters.

Parameters

params (dict | None) – Attributes that matching tasks should have. For a list of possible parameters, see https://developers.asana.com/docs/get-multiple-tasks

Returns

A list of dicts containing attributes of matching Asana tasks

Return type

list

update_task(task_id, params)[source]

Update an existing Asana task.

Parameters
Returns

A dict containing the updated task’s attributes

Return type

dict

create_project(params)[source]

Create a new project.

Parameters

params (dict) – Attributes that the new project should have. See https://developers.asana.com/docs/create-a-project#create-a-project-parameters for a list of possible parameters.

Returns

A dict containing the new project’s attributes, including its GID.

Return type

dict

find_project(params)[source]

Retrieve a list of Asana projects that match search parameters.

Parameters

params (dict) – Attributes which matching projects should have. See https://developers.asana.com/docs/get-multiple-projects for a list of possible parameters.

Returns

A list of dicts containing attributes of matching Asana projects

Return type

list

update_project(project_id, params)[source]

Update an existing project.

Parameters
Returns

A dict containing the updated project’s attributes

Return type

dict

delete_project(project_id)[source]

Delete a project.

Parameters

project_id (str) – Asana GID of the project to delete

Returns

A dict containing the response from Asana

Return type

dict

Was this entry helpful?