kodexa 7.4.413375718144__tar.gz → 7.4.413425262381__tar.gz
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.
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/PKG-INFO +1 -1
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/persistence.py +1 -1
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/pipeline/pipeline.py +11 -9
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/platform/client.py +18 -39
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/pyproject.toml +1 -1
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/LICENSE +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/README.md +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/assistant/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/assistant/assistant.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/connectors/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/connectors/connectors.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/dataclasses/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/dataclasses/templates/llm_data_class.j2 +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/base.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/entities/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/entities/check_response.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/entities/product.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/entities/product_group.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/entities/product_subscription.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/model.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/objects.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/model/utils.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/pipeline/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/platform/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/platform/interaction.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/platform/kodexa.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/selectors/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/selectors/ast.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/selectors/core.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/selectors/lexrules.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/selectors/lextab.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/selectors/lextab.pyi +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/selectors/parserules.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/selectors/parserules.pyi +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/selectors/parsetab.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/selectors/parsetab.pyi +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/spatial/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/spatial/azure_models.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/spatial/bbox_common.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/spatial/table_form_common.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/steps/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/steps/common.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/testing/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/testing/test_components.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/testing/test_utils.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/training/__init__.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/training/train_utils.py +0 -0
- {kodexa-7.4.413375718144 → kodexa-7.4.413425262381}/kodexa/utils/__init__.py +0 -0
@@ -1054,7 +1054,7 @@ class SqliteDocumentPersistence(object):
|
|
1054
1054
|
"""
|
1055
1055
|
model_insights = []
|
1056
1056
|
for model_insight in self.cursor.execute(MODEL_INSIGHT_SELECT).fetchall():
|
1057
|
-
model_insights.append(ModelInsight.
|
1057
|
+
model_insights.append(ModelInsight.model_validate_json(model_insight[0]))
|
1058
1058
|
|
1059
1059
|
return model_insights
|
1060
1060
|
|
@@ -198,11 +198,11 @@ class PipelineContext:
|
|
198
198
|
"""
|
199
199
|
self.current_document = current_document
|
200
200
|
|
201
|
-
def get_current_document(self) -> Document:
|
201
|
+
def get_current_document(self) -> Optional[Document]:
|
202
202
|
"""Gets the current document being processed in the pipeline.
|
203
203
|
|
204
204
|
Returns:
|
205
|
-
Document: The current document being processed in the pipeline.
|
205
|
+
Optional[Document]: The current document being processed in the pipeline.
|
206
206
|
"""
|
207
207
|
return self.current_document
|
208
208
|
|
@@ -244,7 +244,7 @@ class PipelineStep:
|
|
244
244
|
options = step['options']
|
245
245
|
else:
|
246
246
|
options = {}
|
247
|
-
except:
|
247
|
+
except Exception:
|
248
248
|
options = {}
|
249
249
|
self.step = step
|
250
250
|
self.name = name
|
@@ -329,11 +329,13 @@ class PipelineStep:
|
|
329
329
|
import copy
|
330
330
|
|
331
331
|
option_copy = copy.deepcopy(self.options)
|
332
|
-
|
333
|
-
|
334
|
-
|
332
|
+
if hasattr(self.step, 'process'):
|
333
|
+
if hasattr(self.step.process, '__call__'):
|
334
|
+
result_document = self.step.process(document, context)
|
335
|
+
else:
|
336
|
+
result_document = document
|
335
337
|
else:
|
336
|
-
result_document =
|
338
|
+
result_document = document
|
337
339
|
|
338
340
|
elif not callable(self.step):
|
339
341
|
logger.info(f"Starting step {type(self.step)}")
|
@@ -513,7 +515,7 @@ class Pipeline:
|
|
513
515
|
options = step['options']
|
514
516
|
else:
|
515
517
|
options = {}
|
516
|
-
except:
|
518
|
+
except Exception:
|
517
519
|
options = {}
|
518
520
|
self.steps.append(
|
519
521
|
PipelineStep(
|
@@ -567,7 +569,7 @@ class Pipeline:
|
|
567
569
|
self.context.stop_on_exception = self.stop_on_exception
|
568
570
|
|
569
571
|
self.context.statistics = PipelineStatistics()
|
570
|
-
self.context.parameters
|
572
|
+
self.context.context.update(parameters)
|
571
573
|
|
572
574
|
logger.info(f"Starting pipeline {self.name}")
|
573
575
|
|
@@ -234,7 +234,7 @@ class ProjectResourceEndpoint(ClientEndpoint):
|
|
234
234
|
Returns:
|
235
235
|
str: The type of the endpoint.
|
236
236
|
"""
|
237
|
-
|
237
|
+
return "resources"
|
238
238
|
|
239
239
|
def get_instance_class(self, object_dict=None):
|
240
240
|
"""
|
@@ -276,10 +276,10 @@ class ProjectResourceEndpoint(ClientEndpoint):
|
|
276
276
|
df.drop(columns="client", axis=1)
|
277
277
|
return df
|
278
278
|
|
279
|
-
def stream_list(self, query="*", sort=None, filters: List[str] = None):
|
279
|
+
def stream_list(self, query: str = "*", sort: Optional[str] = None, filters: Optional[List[str]] = None):
|
280
280
|
return self.stream(query, sort=sort, filters=filters)
|
281
281
|
|
282
|
-
def stream(self, query="*", sort=None, filters: List[str] = None):
|
282
|
+
def stream(self, query: str = "*", sort: Optional[str] = None, filters: Optional[List[str]] = None):
|
283
283
|
"""
|
284
284
|
Stream the list of resources.
|
285
285
|
|
@@ -306,7 +306,8 @@ class ProjectResourceEndpoint(ClientEndpoint):
|
|
306
306
|
page += 1
|
307
307
|
|
308
308
|
def list(
|
309
|
-
self, query="*", page=1, page_size=10, sort
|
309
|
+
self, query: str = "*", page: int = 1, page_size: int = 10, sort: Optional[str] = None,
|
310
|
+
filters: Optional[List[str]] = None
|
310
311
|
):
|
311
312
|
"""
|
312
313
|
List the resources.
|
@@ -454,10 +455,10 @@ class ComponentEndpoint(ClientEndpoint, OrganizationOwned):
|
|
454
455
|
return None
|
455
456
|
return component_page.content[0]
|
456
457
|
|
457
|
-
def stream_list(self, query="*", sort=None, filters: List[str] = None):
|
458
|
+
def stream_list(self, query: str = "*", sort: Optional[str] = None, filters: Optional[List[str]] = None):
|
458
459
|
return self.stream(query, sort, filters)
|
459
460
|
|
460
|
-
def stream(self, query="*", sort=None, filters: List[str] = None):
|
461
|
+
def stream(self, query: str = "*", sort: Optional[str] = None, filters: Optional[List[str]] = None):
|
461
462
|
"""
|
462
463
|
Stream components matching query, sort and filters.
|
463
464
|
|
@@ -501,7 +502,8 @@ class ComponentEndpoint(ClientEndpoint, OrganizationOwned):
|
|
501
502
|
params["page"] += 1
|
502
503
|
|
503
504
|
def list(
|
504
|
-
self, query="*", page=1, page_size=10, sort
|
505
|
+
self, query: str = "*", page: int = 1, page_size: int = 10, sort: Optional[str] = None,
|
506
|
+
filters: Optional[List[str]] = None
|
505
507
|
):
|
506
508
|
"""
|
507
509
|
List the components.
|
@@ -698,10 +700,10 @@ class EntitiesEndpoint:
|
|
698
700
|
self.client: "KodexaClient" = client
|
699
701
|
self.organization: Optional["OrganizationEndpoint"] = organization
|
700
702
|
|
701
|
-
def stream_list(self, query="*", sort=None, filters: List[str] = None):
|
703
|
+
def stream_list(self, query: str = "*", sort: Optional[str] = None, filters: Optional[List[str]] = None):
|
702
704
|
return self.stream(query, sort=sort, filters=filters)
|
703
705
|
|
704
|
-
def stream(self, query="*", sort=None, filters: List[str] = None):
|
706
|
+
def stream(self, query: str = "*", sort: Optional[str] = None, filters: Optional[List[str]] = None):
|
705
707
|
"""Stream the list of resources.
|
706
708
|
|
707
709
|
Args:
|
@@ -728,7 +730,8 @@ class EntitiesEndpoint:
|
|
728
730
|
page += 1
|
729
731
|
|
730
732
|
def list(
|
731
|
-
self, query="*", page=1, page_size=10, sort
|
733
|
+
self, query: str = "*", page: int = 1, page_size: int = 10, sort: Optional[str] = None,
|
734
|
+
filters: Optional[List[str]] = None
|
732
735
|
):
|
733
736
|
"""List the resources.
|
734
737
|
|
@@ -1192,16 +1195,6 @@ class TaskEndpoint(EntityEndpoint, Task):
|
|
1192
1195
|
def get_type(self) -> str:
|
1193
1196
|
return "tasks"
|
1194
1197
|
|
1195
|
-
def create_with_request(self, task: Task, task_template: Optional[TaskTemplate] = None, document_families: Optional[List[DocumentFamily]] = None):
|
1196
|
-
"""Create a task with the given request."""
|
1197
|
-
url = "/api/tasks/createTaskWithRequest"
|
1198
|
-
response = self.client.post(url, body={
|
1199
|
-
"task": task.model_dump(mode="json", by_alias=True),
|
1200
|
-
"taskTemplate": task_template.model_dump(mode="json", by_alias=True) if task_template else None,
|
1201
|
-
"documentFamilies": [df.model_dump(mode="json", by_alias=True) for df in document_families] if document_families else None
|
1202
|
-
})
|
1203
|
-
return TaskEndpoint.model_validate(response.json()).set_client(self.client)
|
1204
|
-
|
1205
1198
|
def update_status(self, status: TaskStatus):
|
1206
1199
|
"""Update the status of the task."""
|
1207
1200
|
url = f"/api/tasks/{self.id}/status"
|
@@ -1827,9 +1820,9 @@ class OrganizationEndpoint(Organization, EntityEndpoint):
|
|
1827
1820
|
Get the subscriptions of the organization.
|
1828
1821
|
|
1829
1822
|
Returns:
|
1830
|
-
The subscriptions of the organization.
|
1823
|
+
PageProductSubscriptionEndpoint: The subscriptions of the organization.
|
1831
1824
|
"""
|
1832
|
-
url =
|
1825
|
+
url = "/api/productSubscriptions"
|
1833
1826
|
params = {
|
1834
1827
|
"filter": f"organization.id: '{self.id}'",
|
1835
1828
|
"page": page,
|
@@ -2151,7 +2144,7 @@ class AssistantEndpoint(Assistant, ClientEndpoint):
|
|
2151
2144
|
Returns:
|
2152
2145
|
ExecutionEndpoint: The execution endpoint of the event.
|
2153
2146
|
"""
|
2154
|
-
url = f"/api/projects/{self.project.id}/assistants/{self.id}/
|
2147
|
+
url = f"/api/projects/{self.project.id}/assistants/{self.id}/events"
|
2155
2148
|
event_object = {"eventType": event_type, "options": json.dumps(options)}
|
2156
2149
|
response = self.client.post(url, data=event_object, files={})
|
2157
2150
|
process_response(response)
|
@@ -2705,21 +2698,6 @@ class TaskTemplateEndpoint(EntityEndpoint, Task):
|
|
2705
2698
|
return "taskTemplates"
|
2706
2699
|
|
2707
2700
|
|
2708
|
-
class TaskEndpoint(EntityEndpoint, Task):
|
2709
|
-
"""Represents a task endpoint.
|
2710
|
-
|
2711
|
-
This class is used to interact with the task endpoint of the API.
|
2712
|
-
"""
|
2713
|
-
|
2714
|
-
def get_type(self) -> str:
|
2715
|
-
"""Get the type of the endpoint.
|
2716
|
-
|
2717
|
-
Returns:
|
2718
|
-
str: The type of the endpoint, in this case "projects".
|
2719
|
-
"""
|
2720
|
-
return "tasks"
|
2721
|
-
|
2722
|
-
|
2723
2701
|
class RetainedGuidanceEndpoint(EntityEndpoint, RetainedGuidance):
|
2724
2702
|
"""Represents a retained guidance endpoint.
|
2725
2703
|
|
@@ -5201,7 +5179,8 @@ class DataStoreExceptionsEndpoint(EntitiesEndpoint):
|
|
5201
5179
|
super().__init__(client)
|
5202
5180
|
|
5203
5181
|
def list(
|
5204
|
-
self, query="*", page=1, page_size=10, sort
|
5182
|
+
self, query: str = "*", page: int = 1, page_size: int = 10, sort: Optional[str] = None,
|
5183
|
+
filters: Optional[List[str]] = None
|
5205
5184
|
):
|
5206
5185
|
"""
|
5207
5186
|
Lists the data exceptions.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "kodexa"
|
3
|
-
version = "7.4.
|
3
|
+
version = "7.4.413425262381"
|
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.413375718144 → kodexa-7.4.413425262381}/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.413375718144 → kodexa-7.4.413425262381}/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
|