kodexa 7.4.413228596953__tar.gz → 7.4.413229965531__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/PKG-INFO +1 -1
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/platform/client.py +233 -8
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/pyproject.toml +1 -1
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/LICENSE +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/README.md +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/assistant/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/assistant/assistant.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/connectors/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/connectors/connectors.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/dataclasses/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/dataclasses/templates/llm_data_class.j2 +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/base.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/entities/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/entities/check_response.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/entities/product.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/entities/product_group.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/entities/product_subscription.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/model.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/objects.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/persistence.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/utils.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/pipeline/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/pipeline/pipeline.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/platform/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/platform/interaction.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/platform/kodexa.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/selectors/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/selectors/ast.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/selectors/core.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/selectors/lexrules.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/selectors/lextab.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/selectors/lextab.pyi +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/selectors/parserules.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/selectors/parserules.pyi +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/selectors/parsetab.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/selectors/parsetab.pyi +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/spatial/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/spatial/azure_models.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/spatial/bbox_common.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/spatial/table_form_common.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/steps/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/steps/common.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/testing/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/testing/test_components.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/testing/test_utils.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/training/__init__.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/training/train_utils.py +0 -0
- {kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/utils/__init__.py +0 -0
@@ -86,7 +86,8 @@ from kodexa.model.objects import (
|
|
86
86
|
PageExtensionPack,
|
87
87
|
PageOrganization,
|
88
88
|
DocumentFamilyStatistics, MessageContext, PagePrompt, Prompt, GuidanceSet, PageGuidanceSet, DocumentEmbedding,
|
89
|
-
DocumentExternalData, Task, PageTask, RetainedGuidance, PageRetainedGuidance,
|
89
|
+
DocumentExternalData, Task, PageTask, RetainedGuidance, PageRetainedGuidance, TaskTemplate, TaskStatus,
|
90
|
+
TaskActivity, TaskDocumentFamily, TaskTag,
|
90
91
|
)
|
91
92
|
|
92
93
|
logger = logging.getLogger()
|
@@ -1174,8 +1175,171 @@ class PagePipelineEndpoint(PagePipeline, PageEndpoint):
|
|
1174
1175
|
|
1175
1176
|
|
1176
1177
|
class PageTaskEndpoint(PageTask, PageEndpoint):
|
1178
|
+
"""
|
1179
|
+
Represents a page of tasks.
|
1180
|
+
"""
|
1181
|
+
def get_type(self) -> Optional[str]:
|
1182
|
+
return "tasks"
|
1183
|
+
|
1184
|
+
class PageTaskActivityEndpoint(PageEndpoint):
|
1185
|
+
"""
|
1186
|
+
Represents a page of task activities.
|
1187
|
+
"""
|
1188
|
+
def get_type(self) -> Optional[str]:
|
1189
|
+
return "taskActivities"
|
1190
|
+
|
1191
|
+
class PageTaskDocumentFamilyEndpoint(PageEndpoint):
|
1192
|
+
"""
|
1193
|
+
Represents a page of task document families.
|
1194
|
+
"""
|
1195
|
+
def get_type(self) -> Optional[str]:
|
1196
|
+
return "taskDocumentFamilies"
|
1197
|
+
|
1198
|
+
class PageTaskTagEndpoint(PageEndpoint):
|
1199
|
+
"""
|
1200
|
+
Represents a page of task tags.
|
1201
|
+
"""
|
1202
|
+
def get_type(self) -> Optional[str]:
|
1203
|
+
return "taskTags"
|
1204
|
+
|
1205
|
+
class TaskEndpoint(EntityEndpoint, Task):
|
1206
|
+
"""
|
1207
|
+
Represents a task endpoint.
|
1208
|
+
"""
|
1209
|
+
def get_type(self) -> str:
|
1210
|
+
return "tasks"
|
1211
|
+
|
1212
|
+
def create_with_request(self, task: Task, task_template: Optional[TaskTemplate] = None, document_families: Optional[List[DocumentFamily]] = None):
|
1213
|
+
"""Create a task with the given request."""
|
1214
|
+
url = "/api/tasks/createTaskWithRequest"
|
1215
|
+
response = self.client.post(url, body={
|
1216
|
+
"task": task.model_dump(mode="json", by_alias=True),
|
1217
|
+
"taskTemplate": task_template.model_dump(mode="json", by_alias=True) if task_template else None,
|
1218
|
+
"documentFamilies": [df.model_dump(mode="json", by_alias=True) for df in document_families] if document_families else None
|
1219
|
+
})
|
1220
|
+
return TaskEndpoint.model_validate(response.json()).set_client(self.client)
|
1221
|
+
|
1222
|
+
def update_status(self, status: TaskStatus):
|
1223
|
+
"""Update the status of the task."""
|
1224
|
+
url = f"/api/tasks/{self.id}/status"
|
1225
|
+
response = self.client.put(url, body=status)
|
1226
|
+
return TaskEndpoint.model_validate(response.json()).set_client(self.client)
|
1227
|
+
|
1228
|
+
def remove_status(self):
|
1229
|
+
"""Remove the task status."""
|
1230
|
+
url = f"/api/tasks/{self.id}/status"
|
1231
|
+
response = self.client.delete(url)
|
1232
|
+
return TaskEndpoint.model_validate(response.json()).set_client(self.client)
|
1233
|
+
|
1234
|
+
def update_assignee(self, assignee: User):
|
1235
|
+
"""Update the assignee of the task."""
|
1236
|
+
url = f"/api/tasks/{self.id}/assignee"
|
1237
|
+
response = self.client.put(url, body=assignee.model_dump(mode="json", by_alias=True))
|
1238
|
+
return TaskEndpoint.model_validate(response.json()).set_client(self.client)
|
1239
|
+
|
1240
|
+
def remove_assignee(self):
|
1241
|
+
"""Remove the task assignee."""
|
1242
|
+
url = f"/api/tasks/{self.id}/assignee"
|
1243
|
+
response = self.client.delete(url)
|
1244
|
+
return TaskEndpoint.model_validate(response.json()).set_client(self.client)
|
1245
|
+
|
1246
|
+
class TasksEndpoint(EntitiesEndpoint):
|
1247
|
+
"""
|
1248
|
+
Represents tasks endpoints.
|
1249
|
+
"""
|
1250
|
+
def get_type(self) -> str:
|
1251
|
+
return "tasks"
|
1252
|
+
|
1253
|
+
def get_instance_class(self, object_dict=None):
|
1254
|
+
return TaskEndpoint
|
1255
|
+
|
1256
|
+
def get_page_class(self, object_dict=None):
|
1257
|
+
return PageTaskEndpoint
|
1258
|
+
|
1259
|
+
class TaskTemplateEndpoint(EntityEndpoint, TaskTemplate):
|
1260
|
+
"""
|
1261
|
+
Represents a task template endpoint.
|
1262
|
+
"""
|
1263
|
+
def get_type(self) -> str:
|
1264
|
+
return "taskTemplates"
|
1265
|
+
|
1266
|
+
class TaskTemplatesEndpoint(EntitiesEndpoint):
|
1267
|
+
"""
|
1268
|
+
Represents task templates endpoints.
|
1269
|
+
"""
|
1270
|
+
def get_type(self) -> str:
|
1271
|
+
return "taskTemplates"
|
1272
|
+
|
1273
|
+
def get_instance_class(self, object_dict=None):
|
1274
|
+
return TaskTemplateEndpoint
|
1275
|
+
|
1276
|
+
def get_page_class(self, object_dict=None):
|
1277
|
+
return PageTaskTemplateEndpoint
|
1278
|
+
|
1279
|
+
class TaskActivityEndpoint(EntityEndpoint, TaskActivity):
|
1280
|
+
"""
|
1281
|
+
Represents a task activity endpoint.
|
1282
|
+
"""
|
1283
|
+
def get_type(self) -> str:
|
1284
|
+
return "taskActivities"
|
1285
|
+
|
1286
|
+
class TaskActivitiesEndpoint(EntitiesEndpoint):
|
1287
|
+
"""
|
1288
|
+
Represents task activities endpoints.
|
1289
|
+
"""
|
1290
|
+
def get_type(self) -> str:
|
1291
|
+
return "taskActivities"
|
1292
|
+
|
1293
|
+
def get_instance_class(self, object_dict=None):
|
1294
|
+
return TaskActivityEndpoint
|
1295
|
+
|
1296
|
+
def get_page_class(self, object_dict=None):
|
1297
|
+
return PageTaskActivityEndpoint
|
1298
|
+
|
1299
|
+
class TaskDocumentFamilyEndpoint(EntityEndpoint, TaskDocumentFamily):
|
1300
|
+
"""
|
1301
|
+
Represents a task document family endpoint.
|
1302
|
+
"""
|
1303
|
+
def get_type(self) -> str:
|
1304
|
+
return "taskDocumentFamilies"
|
1305
|
+
|
1306
|
+
class TaskDocumentFamiliesEndpoint(EntitiesEndpoint):
|
1307
|
+
"""
|
1308
|
+
Represents task document families endpoints.
|
1309
|
+
"""
|
1310
|
+
def get_type(self) -> str:
|
1311
|
+
return "taskDocumentFamilies"
|
1312
|
+
|
1313
|
+
def get_instance_class(self, object_dict=None):
|
1314
|
+
return TaskDocumentFamilyEndpoint
|
1315
|
+
|
1316
|
+
def get_page_class(self, object_dict=None):
|
1317
|
+
return PageTaskDocumentFamilyEndpoint
|
1318
|
+
|
1319
|
+
class TaskTagEndpoint(EntityEndpoint, TaskTag):
|
1320
|
+
"""
|
1321
|
+
Represents a task tag endpoint.
|
1322
|
+
"""
|
1323
|
+
def get_type(self) -> str:
|
1324
|
+
return "taskTags"
|
1325
|
+
|
1326
|
+
class TaskTagsEndpoint(EntitiesEndpoint):
|
1327
|
+
"""
|
1328
|
+
Represents task tags endpoints.
|
1329
|
+
"""
|
1330
|
+
def get_type(self) -> str:
|
1331
|
+
return "taskTags"
|
1332
|
+
|
1333
|
+
def get_instance_class(self, object_dict=None):
|
1334
|
+
return TaskTagEndpoint
|
1335
|
+
|
1336
|
+
def get_page_class(self, object_dict=None):
|
1337
|
+
return PageTaskTagEndpoint
|
1338
|
+
|
1339
|
+
|
1340
|
+
class PageTaskTemplateEndpoint(PageTask, PageEndpoint):
|
1177
1341
|
def get_type(self) -> Optional[str]:
|
1178
|
-
return "
|
1342
|
+
return "taskTemplate"
|
1179
1343
|
|
1180
1344
|
|
1181
1345
|
class PageRetainedGuidanceEndpoint(PageRetainedGuidance, PageEndpoint):
|
@@ -2546,6 +2710,21 @@ class WorkspaceEndpoint(EntityEndpoint, Workspace):
|
|
2546
2710
|
raise ValueError("Workspace has no channel")
|
2547
2711
|
|
2548
2712
|
|
2713
|
+
class TaskTemplateEndpoint(EntityEndpoint, Task):
|
2714
|
+
"""Represents a task endpoint.
|
2715
|
+
|
2716
|
+
This class is used to interact with the task endpoint of the API.
|
2717
|
+
"""
|
2718
|
+
|
2719
|
+
def get_type(self) -> str:
|
2720
|
+
"""Get the type of the endpoint.
|
2721
|
+
|
2722
|
+
Returns:
|
2723
|
+
str: The type of the endpoint, in this case "projects".
|
2724
|
+
"""
|
2725
|
+
return "taskTemplates"
|
2726
|
+
|
2727
|
+
|
2549
2728
|
class TaskEndpoint(EntityEndpoint, Task):
|
2550
2729
|
"""Represents a task endpoint.
|
2551
2730
|
|
@@ -2906,6 +3085,37 @@ class AssistantsEndpoint(EntitiesEndpoint):
|
|
2906
3085
|
return PageAssistantEndpoint
|
2907
3086
|
|
2908
3087
|
|
3088
|
+
class TaskTemplatesEndpoint(EntitiesEndpoint):
|
3089
|
+
"""Represents a projects endpoint"""
|
3090
|
+
|
3091
|
+
def get_type(self) -> str:
|
3092
|
+
"""
|
3093
|
+
Get the type of the endpoint.
|
3094
|
+
|
3095
|
+
Returns:
|
3096
|
+
str: The type of the endpoint.
|
3097
|
+
"""
|
3098
|
+
return "taskTemplates"
|
3099
|
+
|
3100
|
+
def get_instance_class(self, object_dict=None):
|
3101
|
+
"""
|
3102
|
+
Get the instance class of the endpoint.
|
3103
|
+
|
3104
|
+
Returns:
|
3105
|
+
ProjectEndpoint: The instance class of the endpoint.
|
3106
|
+
"""
|
3107
|
+
return TaskTemplateEndpoint
|
3108
|
+
|
3109
|
+
def get_page_class(self, object_dict=None):
|
3110
|
+
"""
|
3111
|
+
Get the page class of the endpoint.
|
3112
|
+
|
3113
|
+
Returns:
|
3114
|
+
PageProjectEndpoint: The page class of the endpoint.
|
3115
|
+
"""
|
3116
|
+
return PageTaskTemplateEndpoint
|
3117
|
+
|
3118
|
+
|
2909
3119
|
class TasksEndpoint(EntitiesEndpoint):
|
2910
3120
|
"""Represents a projects endpoint"""
|
2911
3121
|
|
@@ -4616,11 +4826,11 @@ class DocumentFamilyEndpoint(DocumentFamily, ClientEndpoint):
|
|
4616
4826
|
url = f"/api/documentFamilies/{self.id}/externalData"
|
4617
4827
|
response = self.client.put(url, body=external_data)
|
4618
4828
|
return response.json()
|
4619
|
-
|
4829
|
+
|
4620
4830
|
def get_json(
|
4621
4831
|
self,
|
4622
4832
|
project_id: str,
|
4623
|
-
friendly_names=False,
|
4833
|
+
friendly_names=False,
|
4624
4834
|
) -> str:
|
4625
4835
|
"""Get the JSON export for the document family
|
4626
4836
|
|
@@ -4635,7 +4845,7 @@ class DocumentFamilyEndpoint(DocumentFamily, ClientEndpoint):
|
|
4635
4845
|
raise Exception(
|
4636
4846
|
f"Project ID is required"
|
4637
4847
|
)
|
4638
|
-
|
4848
|
+
|
4639
4849
|
url = f"/api/stores/{self.store_ref.replace(':', '/')}/families/{self.id}/dataObjects"
|
4640
4850
|
params = {
|
4641
4851
|
"format": "json",
|
@@ -4698,9 +4908,9 @@ class DocumentFamilyEndpoint(DocumentFamily, ClientEndpoint):
|
|
4698
4908
|
"Waiting for mixin and/or label to be available on document family %s",
|
4699
4909
|
self.id,
|
4700
4910
|
)
|
4701
|
-
if polling_delay_in_seconds < 5:
|
4911
|
+
if polling_delay_in_seconds < 5:
|
4702
4912
|
polling_delay_in_seconds = 5
|
4703
|
-
|
4913
|
+
|
4704
4914
|
start = time.time()
|
4705
4915
|
while time.time() - start < timeout:
|
4706
4916
|
url = f"/api/stores/{self.store_ref.replace(':', '/')}/families/{self.id}"
|
@@ -4856,6 +5066,7 @@ class DocumentFamilyEndpoint(DocumentFamily, ClientEndpoint):
|
|
4856
5066
|
params=params,
|
4857
5067
|
files={"file": document.to_kddb()},
|
4858
5068
|
)
|
5069
|
+
|
4859
5070
|
def export_as_zip(self) -> bytes:
|
4860
5071
|
"""
|
4861
5072
|
Export the document family as bytes.
|
@@ -5172,7 +5383,7 @@ class DataStoreEndpoint(StoreEndpoint):
|
|
5172
5383
|
|
5173
5384
|
response = self.client.get(url, params=params)
|
5174
5385
|
return response.text
|
5175
|
-
|
5386
|
+
|
5176
5387
|
def get_taxonomies(self) -> List[Taxonomy]:
|
5177
5388
|
"""Get the taxonomies of the store
|
5178
5389
|
|
@@ -6386,6 +6597,20 @@ OBJECT_TYPES = {
|
|
6386
6597
|
"global": True,
|
6387
6598
|
"endpoint": MembershipsEndpoint,
|
6388
6599
|
},
|
6600
|
+
"tasks": {
|
6601
|
+
"name": "task",
|
6602
|
+
"plural": "tasks",
|
6603
|
+
"type": TaskEndpoint,
|
6604
|
+
"global": True,
|
6605
|
+
"endpoint": TasksEndpoint,
|
6606
|
+
},
|
6607
|
+
"taskTemplates": {
|
6608
|
+
"name": "taskTemplate",
|
6609
|
+
"plural": "taskTemplates",
|
6610
|
+
"type": TaskTemplateEndpoint,
|
6611
|
+
"global": True,
|
6612
|
+
"endpoint": TaskTemplatesEndpoint,
|
6613
|
+
}
|
6389
6614
|
}
|
6390
6615
|
|
6391
6616
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "kodexa"
|
3
|
-
version = "7.4.
|
3
|
+
version = "7.4.413229965531"
|
4
4
|
description = "Python SDK for the Kodexa Platform"
|
5
5
|
authors = ["Austin Redenbaugh <austin@kodexa.com>", "Philip Dodds <philip@kodexa.com>", "Romar Cablao <rcablao@kodexa.com>", "Amadea Paula Dodds <amadeapaula@kodexa.com>"]
|
6
6
|
readme = "README.md"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/dataclasses/templates/llm_data_class.j2
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{kodexa-7.4.413228596953 → kodexa-7.4.413229965531}/kodexa/model/entities/product_subscription.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|