kodexa 7.4.412833907659__tar.gz → 7.4.413039380629__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/PKG-INFO +1 -1
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/dataclasses/__init__.py +21 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/objects.py +20 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/pyproject.toml +1 -1
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/LICENSE +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/README.md +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/assistant/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/assistant/assistant.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/connectors/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/connectors/connectors.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/dataclasses/templates/llm_data_class.j2 +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/base.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/entities/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/entities/check_response.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/entities/product.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/entities/product_group.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/entities/product_subscription.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/model.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/persistence.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/model/utils.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/pipeline/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/pipeline/pipeline.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/platform/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/platform/client.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/platform/interaction.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/platform/kodexa.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/selectors/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/selectors/ast.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/selectors/core.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/selectors/lexrules.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/selectors/lextab.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/selectors/lextab.pyi +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/selectors/parserules.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/selectors/parserules.pyi +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/selectors/parsetab.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/selectors/parsetab.pyi +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/spatial/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/spatial/azure_models.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/spatial/bbox_common.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/spatial/table_form_common.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/steps/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/steps/common.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/testing/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/testing/test_components.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/testing/test_utils.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/training/__init__.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/training/train_utils.py +0 -0
- {kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/kodexa/utils/__init__.py +0 -0
@@ -70,6 +70,14 @@ class LLMDataAttribute(BaseModel):
|
|
70
70
|
)
|
71
71
|
self.exceptions.append(content_exception)
|
72
72
|
|
73
|
+
def to_dict(self, taxonomy: Taxonomy) -> dict:
|
74
|
+
"""Convert attribute to JSON with normalized value"""
|
75
|
+
|
76
|
+
taxon_external_name = taxonomy.get_taxon_by_path(self.taxon_path).external_name
|
77
|
+
return {
|
78
|
+
taxon_external_name: self.normalized_text if self.normalized_text else self.value
|
79
|
+
}
|
80
|
+
|
73
81
|
|
74
82
|
class LLMDataObject(BaseModel):
|
75
83
|
"""
|
@@ -154,6 +162,19 @@ class LLMDataObject(BaseModel):
|
|
154
162
|
if 'normalized_text' in field_data:
|
155
163
|
attr.normalized_text = field_data['normalized_text']
|
156
164
|
|
165
|
+
def to_dict(self, taxonomy: Taxonomy) -> dict:
|
166
|
+
"""Convert data object to JSON using normalized values and taxon paths"""
|
167
|
+
result = {}
|
168
|
+
for field in self.__fields__:
|
169
|
+
value = getattr(self, field)
|
170
|
+
if isinstance(value, list):
|
171
|
+
result[field] = [item.to_dict(taxonomy) for item in value if isinstance(item, (LLMDataObject, LLMDataAttribute))]
|
172
|
+
elif isinstance(value, LLMDataAttribute):
|
173
|
+
result.update(value.to_dict(taxonomy))
|
174
|
+
elif isinstance(value, LLMDataObject):
|
175
|
+
result[field] = value.to_dict(taxonomy)
|
176
|
+
return result
|
177
|
+
|
157
178
|
def to_review(self, page_number=None):
|
158
179
|
"""
|
159
180
|
Build a representation of the data object and its data attributes that is a dict that includes the
|
@@ -2731,6 +2731,16 @@ class Taxon(BaseModel):
|
|
2731
2731
|
structure["taxonType"] = self.taxon_type
|
2732
2732
|
return structure
|
2733
2733
|
|
2734
|
+
def get_taxon_by_path(self, path):
|
2735
|
+
if self.path == path:
|
2736
|
+
return self
|
2737
|
+
|
2738
|
+
if self.children:
|
2739
|
+
for child in self.children:
|
2740
|
+
result = child.get_taxon_by_path(path)
|
2741
|
+
if result:
|
2742
|
+
return result
|
2743
|
+
|
2734
2744
|
|
2735
2745
|
class ContentObject(BaseModel):
|
2736
2746
|
"""
|
@@ -5667,6 +5677,16 @@ class Taxonomy(ExtensionPackProvided):
|
|
5667
5677
|
description="A list of references to an external data taxonomy",
|
5668
5678
|
)
|
5669
5679
|
|
5680
|
+
def get_taxon_by_path(self, path):
|
5681
|
+
for taxon in self.taxons:
|
5682
|
+
if taxon.path == path:
|
5683
|
+
return taxon
|
5684
|
+
if taxon.children is not None:
|
5685
|
+
child_taxon = taxon.get_taxon_by_path(path)
|
5686
|
+
if child_taxon is not None:
|
5687
|
+
return child_taxon
|
5688
|
+
return None
|
5689
|
+
|
5670
5690
|
def update_paths(self):
|
5671
5691
|
for taxon in self.taxons:
|
5672
5692
|
taxon.update_path()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "kodexa"
|
3
|
-
version = "7.4.
|
3
|
+
version = "7.4.413039380629"
|
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
|
{kodexa-7.4.412833907659 → kodexa-7.4.413039380629}/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.412833907659 → kodexa-7.4.413039380629}/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
|