kodexa 6.3.37340911498__tar.gz → 7.0.1a7664024353__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-6.3.37340911498 → kodexa-7.0.1a7664024353}/PKG-INFO +6 -5
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/model/model.py +17 -11
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/model/objects.py +1000 -77
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/model/persistence.py +3 -3
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/platform/client.py +174 -24
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/pyproject.toml +8 -7
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/LICENSE +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/README.md +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/assistant/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/assistant/assistant.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/connectors/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/connectors/connectors.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/model/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/model/base.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/pipeline/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/pipeline/pipeline.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/platform/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/platform/kodexa.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/selectors/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/selectors/ast.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/selectors/core.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/selectors/lexrules.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/selectors/lextab.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/selectors/lextab.pyi +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/selectors/parserules.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/selectors/parserules.pyi +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/selectors/parsetab.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/selectors/parsetab.pyi +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/spatial/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/spatial/azure_models.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/spatial/bbox_common.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/spatial/table_form_common.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/steps/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/steps/common.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/testing/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/testing/test_components.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/testing/test_utils.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/training/__init__.py +0 -0
- {kodexa-6.3.37340911498 → kodexa-7.0.1a7664024353}/kodexa/training/train_utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: kodexa
|
3
|
-
Version:
|
3
|
+
Version: 7.0.1a7664024353
|
4
4
|
Summary: Python SDK for the Kodexa Platform
|
5
5
|
Author: Austin Redenbaugh
|
6
6
|
Author-email: austin@kodexa.com
|
@@ -16,17 +16,18 @@ Classifier: Topic :: Software Development :: Libraries
|
|
16
16
|
Requires-Dist: addict (==2.4.0)
|
17
17
|
Requires-Dist: appdirs (>=1.4.4,<2.0.0)
|
18
18
|
Requires-Dist: better-exceptions (>=0.3.3,<0.4.0)
|
19
|
-
Requires-Dist:
|
20
|
-
Requires-Dist:
|
19
|
+
Requires-Dist: chevron (>=0.14.0,<0.15.0)
|
20
|
+
Requires-Dist: deepdiff (>=6.5.0,<7.0.0)
|
21
|
+
Requires-Dist: msgpack (>=1.0.6,<2.0.0)
|
21
22
|
Requires-Dist: ply (>=3.11,<4.0)
|
22
|
-
Requires-Dist: pydantic (
|
23
|
+
Requires-Dist: pydantic (>=2.5.3,<3.0.0)
|
23
24
|
Requires-Dist: pydantic-yaml (>=1.0.0,<2.0.0)
|
24
25
|
Requires-Dist: pyfunctional (>=1.4.3,<1.5.0)
|
25
26
|
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
|
26
27
|
Requires-Dist: pyyaml (>=6.0,<7.0)
|
27
28
|
Requires-Dist: requests (>=2.28.1,<3.0.0)
|
28
29
|
Requires-Dist: semver (>=3.0.1,<4.0.0)
|
29
|
-
Requires-Dist: urllib3 (>=
|
30
|
+
Requires-Dist: urllib3 (>=2.0.0,<3.0.0)
|
30
31
|
Description-Content-Type: text/markdown
|
31
32
|
|
32
33
|
# Kodexa
|
@@ -10,12 +10,12 @@ import uuid
|
|
10
10
|
from enum import Enum
|
11
11
|
from typing import Any, List, Optional
|
12
12
|
|
13
|
+
import deepdiff
|
13
14
|
import msgpack
|
14
15
|
from addict import Dict
|
15
16
|
from pydantic import BaseModel, ConfigDict
|
16
17
|
|
17
18
|
from kodexa.model.objects import ContentObject, FeatureSet
|
18
|
-
import deepdiff
|
19
19
|
|
20
20
|
|
21
21
|
class Ref:
|
@@ -553,11 +553,9 @@ class ContentNode(object):
|
|
553
553
|
>>> new_page.add_feature('pagination','pageNum',1)
|
554
554
|
"""
|
555
555
|
if self.has_feature(feature_type, name):
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
self.update_feature(feature)
|
560
|
-
return feature
|
556
|
+
raise Exception(
|
557
|
+
f"Feature {feature_type}:{name} already exists on this node, use set_feature to update"
|
558
|
+
)
|
561
559
|
|
562
560
|
# Make sure that we treat the value as list all the time
|
563
561
|
new_feature = ContentFeature(
|
@@ -764,7 +762,7 @@ class ContentNode(object):
|
|
764
762
|
"""
|
765
763
|
return self.node_type
|
766
764
|
|
767
|
-
def select_first(self, selector, variables=None):
|
765
|
+
def select_first(self, selector, variables=None) -> Optional["ContentNode"]:
|
768
766
|
"""Select and return the first child of this node that match the selector value.
|
769
767
|
|
770
768
|
Args:
|
@@ -2428,11 +2426,20 @@ class Document(object):
|
|
2428
2426
|
)
|
2429
2427
|
self._persistence_layer.initialize()
|
2430
2428
|
|
2431
|
-
def
|
2429
|
+
def remove_tags_by_owner(self, owner_uri: str):
|
2430
|
+
|
2431
|
+
for tag in self.get_all_tags():
|
2432
|
+
for tag_instance in self.get_tag_instances(tag):
|
2433
|
+
tag_meta: dict = tag_instance.get_data()
|
2434
|
+
if 'owner_uri' in tag_meta and tag_meta['owner_uri'] == owner_uri:
|
2435
|
+
for node in tag_instance.nodes:
|
2436
|
+
node.remove_tag(tag)
|
2437
|
+
|
2438
|
+
def add_tag_instance(self, tag_to_apply:str, node_list: List[ContentNode]):
|
2432
2439
|
"""
|
2433
2440
|
This will create a group of a tag with indexes
|
2434
|
-
:param
|
2435
|
-
:param
|
2441
|
+
:param tag_to_apply: name of the tag
|
2442
|
+
:param node_list: contains the list of index of a node
|
2436
2443
|
:return:
|
2437
2444
|
"""
|
2438
2445
|
# For each node in the list create/update a feature
|
@@ -3050,7 +3057,6 @@ class Document(object):
|
|
3050
3057
|
|
3051
3058
|
node_feature["features"].append(feature_dict)
|
3052
3059
|
|
3053
|
-
|
3054
3060
|
return feature_set
|
3055
3061
|
|
3056
3062
|
def get_all_tagged_nodes(self) -> List[ContentNode]:
|