-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathmanage_tasks.py
More file actions
30 lines (24 loc) · 843 Bytes
/
manage_tasks.py
File metadata and controls
30 lines (24 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
Script: Managing curation tasks.
Covers listing, updating, and deleting curation tasks.
"""
from synapseclient import Synapse
from synapseclient.models import CurationTask
syn = Synapse()
syn.login()
# List tasks in a project
for task in CurationTask.list(project_id="syn123456789"):
print(f"Task {task.task_id}: {task.data_type}")
print(f" Instructions: {task.instructions}")
if task.assignee_principal_id:
print(f" Assigned to: {task.assignee_principal_id}")
# Update a task
task = CurationTask(task_id=42).get()
task.instructions = "Updated instructions for data contributors"
task = task.store()
# Delete a task (simple)
task = CurationTask(task_id=42)
task.delete()
# Delete a task and clean up the associated EntityView (file-based only)
task = CurationTask(task_id=42)
task.delete(delete_file_view=True)