synapse-sdk 2025.9.1__py3-none-any.whl → 2025.9.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of synapse-sdk might be problematic. Click here for more details.

Files changed (81) hide show
  1. synapse_sdk/devtools/docs/docs/api/clients/annotation-mixin.md +378 -0
  2. synapse_sdk/devtools/docs/docs/api/clients/backend.md +368 -1
  3. synapse_sdk/devtools/docs/docs/api/clients/core-mixin.md +477 -0
  4. synapse_sdk/devtools/docs/docs/api/clients/data-collection-mixin.md +422 -0
  5. synapse_sdk/devtools/docs/docs/api/clients/hitl-mixin.md +554 -0
  6. synapse_sdk/devtools/docs/docs/api/clients/index.md +391 -0
  7. synapse_sdk/devtools/docs/docs/api/clients/integration-mixin.md +571 -0
  8. synapse_sdk/devtools/docs/docs/api/clients/ml-mixin.md +578 -0
  9. synapse_sdk/devtools/docs/docs/plugins/developing-upload-template.md +1463 -0
  10. synapse_sdk/devtools/docs/docs/plugins/export-plugins.md +161 -34
  11. synapse_sdk/devtools/docs/docs/plugins/upload-plugins.md +1497 -213
  12. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/annotation-mixin.md +289 -0
  13. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/backend.md +378 -11
  14. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/core-mixin.md +417 -0
  15. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/data-collection-mixin.md +356 -0
  16. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/hitl-mixin.md +192 -0
  17. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/index.md +391 -0
  18. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/integration-mixin.md +479 -0
  19. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/ml-mixin.md +284 -0
  20. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/developing-upload-template.md +1463 -0
  21. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/export-plugins.md +161 -34
  22. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/upload-plugins.md +1752 -572
  23. synapse_sdk/devtools/docs/sidebars.ts +7 -0
  24. synapse_sdk/plugins/README.md +1 -2
  25. synapse_sdk/plugins/categories/base.py +7 -0
  26. synapse_sdk/plugins/categories/export/actions/__init__.py +3 -0
  27. synapse_sdk/plugins/categories/export/actions/export/__init__.py +28 -0
  28. synapse_sdk/plugins/categories/export/actions/export/action.py +160 -0
  29. synapse_sdk/plugins/categories/export/actions/export/enums.py +113 -0
  30. synapse_sdk/plugins/categories/export/actions/export/exceptions.py +53 -0
  31. synapse_sdk/plugins/categories/export/actions/export/models.py +74 -0
  32. synapse_sdk/plugins/categories/export/actions/export/run.py +195 -0
  33. synapse_sdk/plugins/categories/export/actions/export/utils.py +187 -0
  34. synapse_sdk/plugins/categories/export/templates/plugin/__init__.py +1 -1
  35. synapse_sdk/plugins/categories/upload/actions/upload/__init__.py +1 -2
  36. synapse_sdk/plugins/categories/upload/actions/upload/action.py +154 -531
  37. synapse_sdk/plugins/categories/upload/actions/upload/context.py +185 -0
  38. synapse_sdk/plugins/categories/upload/actions/upload/factory.py +143 -0
  39. synapse_sdk/plugins/categories/upload/actions/upload/models.py +66 -29
  40. synapse_sdk/plugins/categories/upload/actions/upload/orchestrator.py +182 -0
  41. synapse_sdk/plugins/categories/upload/actions/upload/registry.py +113 -0
  42. synapse_sdk/plugins/categories/upload/actions/upload/steps/__init__.py +1 -0
  43. synapse_sdk/plugins/categories/upload/actions/upload/steps/base.py +106 -0
  44. synapse_sdk/plugins/categories/upload/actions/upload/steps/cleanup.py +62 -0
  45. synapse_sdk/plugins/categories/upload/actions/upload/steps/collection.py +62 -0
  46. synapse_sdk/plugins/categories/upload/actions/upload/steps/generate.py +80 -0
  47. synapse_sdk/plugins/categories/upload/actions/upload/steps/initialize.py +66 -0
  48. synapse_sdk/plugins/categories/upload/actions/upload/steps/metadata.py +101 -0
  49. synapse_sdk/plugins/categories/upload/actions/upload/steps/organize.py +89 -0
  50. synapse_sdk/plugins/categories/upload/actions/upload/steps/upload.py +96 -0
  51. synapse_sdk/plugins/categories/upload/actions/upload/steps/validate.py +61 -0
  52. synapse_sdk/plugins/categories/upload/actions/upload/strategies/__init__.py +1 -0
  53. synapse_sdk/plugins/categories/upload/actions/upload/strategies/base.py +86 -0
  54. synapse_sdk/plugins/categories/upload/actions/upload/strategies/data_unit/__init__.py +1 -0
  55. synapse_sdk/plugins/categories/upload/actions/upload/strategies/data_unit/batch.py +39 -0
  56. synapse_sdk/plugins/categories/upload/actions/upload/strategies/data_unit/single.py +34 -0
  57. synapse_sdk/plugins/categories/upload/actions/upload/strategies/file_discovery/__init__.py +1 -0
  58. synapse_sdk/plugins/categories/upload/actions/upload/strategies/file_discovery/flat.py +233 -0
  59. synapse_sdk/plugins/categories/upload/actions/upload/strategies/file_discovery/recursive.py +253 -0
  60. synapse_sdk/plugins/categories/upload/actions/upload/strategies/metadata/__init__.py +1 -0
  61. synapse_sdk/plugins/categories/upload/actions/upload/strategies/metadata/excel.py +174 -0
  62. synapse_sdk/plugins/categories/upload/actions/upload/strategies/metadata/none.py +16 -0
  63. synapse_sdk/plugins/categories/upload/actions/upload/strategies/upload/__init__.py +1 -0
  64. synapse_sdk/plugins/categories/upload/actions/upload/strategies/upload/async_upload.py +109 -0
  65. synapse_sdk/plugins/categories/upload/actions/upload/strategies/upload/sync.py +43 -0
  66. synapse_sdk/plugins/categories/upload/actions/upload/strategies/validation/__init__.py +1 -0
  67. synapse_sdk/plugins/categories/upload/actions/upload/strategies/validation/default.py +45 -0
  68. synapse_sdk/plugins/categories/upload/actions/upload/utils.py +194 -83
  69. synapse_sdk/plugins/categories/upload/templates/config.yaml +4 -0
  70. synapse_sdk/plugins/categories/upload/templates/plugin/__init__.py +269 -0
  71. synapse_sdk/plugins/categories/upload/templates/plugin/upload.py +71 -27
  72. synapse_sdk/plugins/models.py +7 -0
  73. synapse_sdk/shared/__init__.py +21 -0
  74. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/METADATA +2 -1
  75. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/RECORD +79 -28
  76. synapse_sdk/plugins/categories/export/actions/export.py +0 -385
  77. synapse_sdk/plugins/categories/export/enums.py +0 -7
  78. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/WHEEL +0 -0
  79. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/entry_points.txt +0 -0
  80. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/licenses/LICENSE +0 -0
  81. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,378 @@
1
+ ---
2
+ id: annotation-mixin
3
+ title: AnnotationClientMixin
4
+ sidebar_position: 2
5
+ ---
6
+
7
+ # AnnotationClientMixin
8
+
9
+ Provides annotation and task management operations for the Synapse backend.
10
+
11
+ ## Overview
12
+
13
+ The `AnnotationClientMixin` handles all operations related to tasks, annotations, projects, and task tagging. This mixin is automatically included in the `BackendClient` and provides methods for annotation workflows.
14
+
15
+ ## Project Operations
16
+
17
+ ### `get_project(pk)`
18
+
19
+ Retrieve detailed information about a specific project.
20
+
21
+ ```python
22
+ project = client.get_project(123)
23
+ print(f"Project: {project['name']}")
24
+ print(f"Description: {project['description']}")
25
+ ```
26
+
27
+ **Parameters:**
28
+
29
+ - `pk` (int): Project ID
30
+
31
+ **Returns:**
32
+
33
+ - `dict`: Project details including configuration, metadata, and settings
34
+
35
+ ## Task Operations
36
+
37
+ ### `get_task(pk, params)`
38
+
39
+ Get detailed information about a specific task.
40
+
41
+ ```python
42
+ # Basic task details
43
+ task = client.get_task(456)
44
+
45
+ # Task with expanded data unit
46
+ task = client.get_task(456, params={'expand': 'data_unit'})
47
+
48
+ # Task with multiple expansions
49
+ task = client.get_task(456, params={
50
+ 'expand': ['data_unit', 'assignment', 'annotations']
51
+ })
52
+ ```
53
+
54
+ **Parameters:**
55
+
56
+ - `pk` (int): Task ID
57
+ - `params` (dict): Query parameters for filtering and expansion
58
+
59
+ **Common params:**
60
+
61
+ - `expand`: List or string of related objects to include
62
+ - `include_annotations`: Whether to include annotation data
63
+
64
+ ### `annotate_task_data(pk, data)`
65
+
66
+ Submit annotation data for a task.
67
+
68
+ ```python
69
+ # Submit bounding box annotations
70
+ annotation_data = {
71
+ 'annotations': [
72
+ {
73
+ 'type': 'bbox',
74
+ 'coordinates': [10, 10, 100, 100],
75
+ 'label': 'person',
76
+ 'confidence': 0.95
77
+ },
78
+ {
79
+ 'type': 'polygon',
80
+ 'points': [[0, 0], [50, 0], [50, 50], [0, 50]],
81
+ 'label': 'vehicle'
82
+ }
83
+ ],
84
+ 'metadata': {
85
+ 'annotator_id': 'user123',
86
+ 'timestamp': '2023-10-01T12:00:00Z'
87
+ }
88
+ }
89
+
90
+ result = client.annotate_task_data(456, annotation_data)
91
+ ```
92
+
93
+ **Parameters:**
94
+
95
+ - `pk` (int): Task ID
96
+ - `data` (dict): Annotation data structure
97
+
98
+ **Returns:**
99
+
100
+ - `dict`: Updated task with submitted annotations
101
+
102
+ ### `list_tasks(params=None, url_conversion=None, list_all=False)`
103
+
104
+ List tasks with filtering and pagination support.
105
+
106
+ ```python
107
+ # List tasks for a specific project
108
+ tasks = client.list_tasks(params={'project': 123})
109
+
110
+ # List tasks with status filter
111
+ tasks = client.list_tasks(params={
112
+ 'project': 123,
113
+ 'status': 'pending'
114
+ })
115
+
116
+ # Get all tasks (handles pagination automatically)
117
+ all_tasks = client.list_tasks(list_all=True)
118
+
119
+ # List tasks with custom URL conversion for files
120
+ tasks = client.list_tasks(
121
+ params={'project': 123},
122
+ url_conversion={'files': lambda url: f"https://cdn.example.com{url}"}
123
+ )
124
+ ```
125
+
126
+ **Parameters:**
127
+
128
+ - `params` (dict, optional): Filtering parameters
129
+ - `url_conversion` (dict, optional): Custom URL conversion for file fields
130
+ - `list_all` (bool): If True, automatically handles pagination to get all results
131
+
132
+ **Common filtering params:**
133
+
134
+ - `project`: Filter by project ID
135
+ - `status`: Filter by task status (`pending`, `in_progress`, `completed`)
136
+ - `assignee`: Filter by assigned user ID
137
+ - `created_after`: Filter by creation date
138
+ - `search`: Text search in task content
139
+
140
+ **Returns:**
141
+
142
+ - `tuple`: (tasks_list, total_count) if `list_all=False`
143
+ - `list`: All tasks if `list_all=True`
144
+
145
+ ### `create_tasks(data)`
146
+
147
+ Create one or more new tasks.
148
+
149
+ ```python
150
+ # Create single task
151
+ new_task = client.create_tasks({
152
+ 'project': 123,
153
+ 'data_unit': 789,
154
+ 'priority': 'high',
155
+ 'metadata': {'batch': 'batch_001'}
156
+ })
157
+
158
+ # Create multiple tasks
159
+ new_tasks = client.create_tasks([
160
+ {'project': 123, 'data_unit': 789},
161
+ {'project': 123, 'data_unit': 790},
162
+ {'project': 123, 'data_unit': 791}
163
+ ])
164
+ ```
165
+
166
+ **Parameters:**
167
+
168
+ - `data` (dict or list): Task data or list of task data
169
+
170
+ **Task data structure:**
171
+
172
+ - `project` (int, required): Project ID
173
+ - `data_unit` (int, required): Data unit ID
174
+ - `priority` (str, optional): Task priority (`low`, `normal`, `high`)
175
+ - `assignee` (int, optional): User ID to assign task to
176
+ - `metadata` (dict, optional): Additional task metadata
177
+
178
+ **Returns:**
179
+
180
+ - `dict` or `list`: Created task(s) with generated IDs
181
+
182
+ ### `set_tags_tasks(data, params=None)`
183
+
184
+ Set tags for multiple tasks in batch.
185
+
186
+ ```python
187
+ # Set tags for multiple tasks
188
+ client.set_tags_tasks({
189
+ 'task_ids': [456, 457, 458],
190
+ 'tag_ids': [1, 2, 3] # Tag IDs to apply
191
+ })
192
+
193
+ # Set tags with additional parameters
194
+ client.set_tags_tasks(
195
+ {
196
+ 'task_ids': [456, 457],
197
+ 'tag_ids': [1, 2]
198
+ },
199
+ params={'replace': True} # Replace existing tags
200
+ )
201
+ ```
202
+
203
+ **Parameters:**
204
+
205
+ - `data` (dict): Batch tagging data
206
+ - `params` (dict, optional): Additional parameters
207
+
208
+ **Data structure:**
209
+
210
+ - `task_ids` (list): List of task IDs to tag
211
+ - `tag_ids` (list): List of tag IDs to apply
212
+
213
+ **Optional params:**
214
+
215
+ - `replace` (bool): If True, replace existing tags; if False, add to existing
216
+
217
+ ## Task Tag Operations
218
+
219
+ ### `get_task_tag(pk)`
220
+
221
+ Get details about a specific task tag.
222
+
223
+ ```python
224
+ tag = client.get_task_tag(123)
225
+ print(f"Tag: {tag['name']} - {tag['description']}")
226
+ ```
227
+
228
+ **Parameters:**
229
+
230
+ - `pk` (int): Tag ID
231
+
232
+ **Returns:**
233
+
234
+ - `dict`: Tag details including name, description, and meta
235
+
236
+ ### `list_task_tags(params)`
237
+
238
+ List available task tags with filtering.
239
+
240
+ ```python
241
+ # List all tags
242
+ tags = client.list_task_tags({})
243
+
244
+ # List tags for a specific project
245
+ project_tags = client.list_task_tags({
246
+ 'project': 123
247
+ })
248
+
249
+ # Search tags by name
250
+ search_tags = client.list_task_tags({
251
+ 'search': 'quality'
252
+ })
253
+ ```
254
+
255
+ **Parameters:**
256
+
257
+ - `params` (dict): Filtering parameters
258
+
259
+ **Common filtering params:**
260
+
261
+ - `project`: Filter by project ID
262
+ - `search`: Text search in tag names
263
+ - `color`: Filter by tag color
264
+
265
+ **Returns:**
266
+
267
+ - `tuple`: (tags_list, total_count)
268
+
269
+ ## Example Workflows
270
+
271
+ ### Complete Annotation Workflow
272
+
273
+ ```python
274
+ from synapse_sdk.clients.backend import BackendClient
275
+
276
+ client = BackendClient(
277
+ base_url="https://api.synapse.sh",
278
+ api_token="your-token"
279
+ )
280
+
281
+ # 1. Get project details
282
+ project = client.get_project(123)
283
+ print(f"Working on project: {project['name']}")
284
+
285
+ # 2. List pending tasks
286
+ pending_tasks = client.list_tasks(params={
287
+ 'project': 123,
288
+ 'status': 'pending'
289
+ })
290
+
291
+ # 3. Process first task
292
+ if pending_tasks[0]:
293
+ task = pending_tasks[0][0] # First task from results
294
+ task_id = task['id']
295
+
296
+ # Get detailed task info
297
+ detailed_task = client.get_task(task_id, params={'expand': 'data_unit'})
298
+
299
+ # Submit annotations
300
+ annotations = {
301
+ 'annotations': [
302
+ {
303
+ 'type': 'bbox',
304
+ 'coordinates': [10, 10, 100, 100],
305
+ 'label': 'person'
306
+ }
307
+ ]
308
+ }
309
+
310
+ result = client.annotate_task_data(task_id, annotations)
311
+ print(f"Annotations submitted for task {task_id}")
312
+
313
+ # Add quality tag
314
+ quality_tags = client.list_task_tags({'search': 'quality'})
315
+ if quality_tags[0]:
316
+ tag_id = quality_tags[0][0]['id']
317
+ client.set_tags_tasks({
318
+ 'task_ids': [task_id],
319
+ 'tag_ids': [tag_id]
320
+ })
321
+ ```
322
+
323
+ ### Batch Task Creation
324
+
325
+ ```python
326
+ # Create tasks for multiple data units
327
+ data_units = [789, 790, 791, 792, 793]
328
+
329
+ tasks_data = []
330
+ for data_unit_id in data_units:
331
+ tasks_data.append({
332
+ 'project': 123,
333
+ 'data_unit': data_unit_id,
334
+ 'priority': 'normal',
335
+ 'metadata': {
336
+ 'batch': 'automated_batch_001',
337
+ 'source': 'data_import'
338
+ }
339
+ })
340
+
341
+ # Create all tasks in one request
342
+ created_tasks = client.create_tasks(tasks_data)
343
+ print(f"Created {len(created_tasks)} tasks")
344
+
345
+ # Get IDs of created tasks
346
+ task_ids = [task['id'] for task in created_tasks]
347
+
348
+ # Apply initial tags
349
+ initial_tags = client.list_task_tags({'search': 'new'})
350
+ if initial_tags[0]:
351
+ tag_id = initial_tags[0][0]['id']
352
+ client.set_tags_tasks({
353
+ 'task_ids': task_ids,
354
+ 'tag_ids': [tag_id]
355
+ })
356
+ ```
357
+
358
+ ## Error Handling
359
+
360
+ ```python
361
+ from synapse_sdk.clients.exceptions import ClientError
362
+
363
+ try:
364
+ task = client.get_task(999999)
365
+ except ClientError as e:
366
+ if e.status_code == 404:
367
+ print("Task not found")
368
+ elif e.status_code == 403:
369
+ print("Permission denied")
370
+ else:
371
+ print(f"API Error: {e}")
372
+ ```
373
+
374
+ ## See Also
375
+
376
+ - [BackendClient](./backend.md) - Main backend client
377
+ - [HITLClientMixin](./hitl-mixin.md) - Human-in-the-loop operations
378
+ - [DataCollectionClientMixin](./data-collection-mixin.md) - Data management