pyegeria 5.4.0.26__py3-none-any.whl → 5.4.0.28__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.
- commands/cat/debug_log +868 -7794
- commands/cat/debug_log.2025-08-18_11-34-38_088636.zip +0 -0
- commands/cat/list_collections.py +1 -1
- commands/cat/list_format_set.py +6 -8
- commands/cli/egeria.py +2 -2
- commands/cli/egeria_cat.py +3 -2
- commands/ops/load_archive.py +2 -2
- md_processing/data/commands.json +7 -7
- md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +7 -7
- md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +36 -31
- md_processing/dr_egeria_outbox/friday/processed-2025-08-22 21:22-dr_egeria_intro_part1.md +312 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-22 21:23-dr_egeria_intro_part1.md +265 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:06-dr_egeria_intro_part1.md +230 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:30-dr_egeria_intro_part1.md +296 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-23 15:31-dr_egeria_intro_part1.md +253 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-23 16:08-dr_egeria_intro_part2.md +343 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-23 16:12-dr_egeria_intro_part2.md +343 -0
- md_processing/md_commands/glossary_commands.py +888 -951
- md_processing/md_commands/product_manager_commands.py +8 -270
- md_processing/md_commands/project_commands.py +1 -1
- md_processing/md_processing_utils/common_md_proc_utils.py +138 -64
- md_processing/md_processing_utils/common_md_utils.py +2 -1
- pyegeria/__init__.py +2 -3
- pyegeria/_client_new.py +4 -3
- pyegeria/_output_formats.py +5 -3
- pyegeria/collection_manager.py +32 -29
- pyegeria/{load_config.py → config.py} +7 -2
- pyegeria/data_designer.py +154 -194
- pyegeria/egeria_cat_client.py +46 -28
- pyegeria/egeria_client.py +71 -72
- pyegeria/egeria_config_client.py +37 -7
- pyegeria/egeria_my_client.py +45 -10
- pyegeria/egeria_tech_client.py +68 -57
- pyegeria/glossary_manager.py +495 -124
- pyegeria/governance_officer.py +2 -2
- pyegeria/logging_configuration.py +1 -4
- pyegeria/models.py +1 -1
- pyegeria/project_manager.py +359 -511
- pyegeria/utils.py +1 -3
- {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/METADATA +1 -1
- {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/RECORD +44 -38
- md_processing/md_processing_utils/solution_architect_log.log +0 -0
- pyegeria/glossary_browser.py +0 -1259
- {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/LICENSE +0 -0
- {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.0.26.dist-info → pyegeria-5.4.0.28.dist-info}/entry_points.txt +0 -0
pyegeria/_output_formats.py
CHANGED
@@ -72,12 +72,12 @@ from loguru import logger
|
|
72
72
|
|
73
73
|
from pyegeria._output_format_models import (Column, Format, ActionParameter, FormatSet, FormatSetDict,
|
74
74
|
save_format_sets_to_json, load_format_sets_from_json)
|
75
|
-
from pyegeria.
|
75
|
+
from pyegeria.config import settings
|
76
76
|
|
77
77
|
|
78
78
|
# Get the configured value for the user format sets directory
|
79
|
-
|
80
|
-
USER_FORMAT_SETS_DIR = os.path.expanduser(
|
79
|
+
|
80
|
+
USER_FORMAT_SETS_DIR = os.path.expanduser(settings.Environment.pyegeria_user_format_sets_dir)
|
81
81
|
|
82
82
|
# Constants
|
83
83
|
MD_SEPARATOR = "\n---\n\n"
|
@@ -122,8 +122,10 @@ COMMON_FORMATS_ALL = Format(
|
|
122
122
|
)
|
123
123
|
|
124
124
|
PROJECT_COLUMNS = COMMON_COLUMNS + [
|
125
|
+
Column(name="Classifications", key='classifications'),
|
125
126
|
Column(name='Priority', key='priority'),
|
126
127
|
Column(name='Project Status', key='project_status'),
|
128
|
+
Column(name='Element Status', key='status'),
|
127
129
|
Column(name='Start Date', key='start_date'),
|
128
130
|
Column(name='Assigned Actors', key='assigned_actors'),
|
129
131
|
Column(name='Resources', key='resource_list'),
|
pyegeria/collection_manager.py
CHANGED
@@ -17,7 +17,7 @@ from pydantic import ValidationError, Field, HttpUrl
|
|
17
17
|
from pyegeria._exceptions_new import PyegeriaInvalidParameterException
|
18
18
|
from pyegeria._globals import NO_ELEMENTS_FOUND, NO_GUID_RETURNED, NO_MEMBERS_FOUND
|
19
19
|
from pyegeria._output_formats import select_output_format_set, get_output_format_type_match
|
20
|
-
from pyegeria.
|
20
|
+
from pyegeria.config import settings
|
21
21
|
from pyegeria.models import (SearchStringRequestBody, FilterRequestBody, GetRequestBody, NewElementRequestBody,
|
22
22
|
ReferenceableProperties, InitialClassifications, TemplateRequestBody,
|
23
23
|
UpdateElementRequestBody, UpdateStatusRequestBody, NewRelationshipRequestBody,
|
@@ -29,7 +29,7 @@ from pyegeria.output_formatter import (generate_output,
|
|
29
29
|
from pyegeria.utils import body_slimmer, dynamic_catch
|
30
30
|
|
31
31
|
|
32
|
-
app_settings =
|
32
|
+
app_settings = settings
|
33
33
|
EGERIA_LOCAL_QUALIFIER = app_settings.User_Profile.egeria_local_qualifier
|
34
34
|
|
35
35
|
COLLECTION_PROPERTIES_LIST = ["CollectionProperties", "DataDictionaryProperties",
|
@@ -1118,7 +1118,7 @@ class CollectionManager(Client2):
|
|
1118
1118
|
if initial_classifications:
|
1119
1119
|
initial_classifications_dict = {}
|
1120
1120
|
for c in initial_classifications:
|
1121
|
-
initial_classifications_dict = initial_classifications_dict | {c : {"class": "
|
1121
|
+
initial_classifications_dict = initial_classifications_dict | {c : {"class": f"{c}Properties"}}
|
1122
1122
|
|
1123
1123
|
else:
|
1124
1124
|
initial_classifications_dict = None
|
@@ -1260,7 +1260,7 @@ class CollectionManager(Client2):
|
|
1260
1260
|
|
1261
1261
|
@dynamic_catch
|
1262
1262
|
def create_root_collection(self, display_name: str = None, description: str = None,
|
1263
|
-
category: str = None,
|
1263
|
+
category: str = None, body: dict | NewElementRequestBody = None) -> str:
|
1264
1264
|
""" Create a new collection with the RootCollection classification. Used to identify the top of a
|
1265
1265
|
collection hierarchy.
|
1266
1266
|
Create Collections: https://egeria-project.org/concepts/collection
|
@@ -1293,8 +1293,8 @@ class CollectionManager(Client2):
|
|
1293
1293
|
"""
|
1294
1294
|
|
1295
1295
|
return asyncio.get_event_loop().run_until_complete(
|
1296
|
-
self._async_create_collection(display_name, description, category,
|
1297
|
-
|
1296
|
+
self._async_create_collection(display_name=display_name, description=description, category=category,
|
1297
|
+
initial_classifications = ["RootCollection"], body=body))
|
1298
1298
|
|
1299
1299
|
|
1300
1300
|
@dynamic_catch
|
@@ -1414,25 +1414,28 @@ class CollectionManager(Client2):
|
|
1414
1414
|
self._async_create_collection(display_name, description, category,
|
1415
1415
|
["ContextEvent"], body))
|
1416
1416
|
|
1417
|
-
@dynamic_catch
|
1418
|
-
def
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1417
|
+
# @dynamic_catch
|
1418
|
+
# def create_glossary(self, display_name: str, description: str = None, language: str = "English", usage: str = None,
|
1419
|
+
# category: str = None, body: dict | NewElementRequestBody = None) -> str:
|
1420
|
+
# """Create a new glossary with optional classification. """
|
1421
|
+
# if body is None:
|
1422
|
+
#
|
1423
|
+
# qualified_name = self.__create_qualified_name__("Glossary", display_name, EGERIA_LOCAL_QUALIFIER)
|
1424
|
+
# body = {
|
1425
|
+
# "class": "NewElementRequestBody",
|
1426
|
+
# "is_own_anchor": True,
|
1427
|
+
# "properties": {
|
1428
|
+
# "class": "GlossaryProperties",
|
1429
|
+
# "displayName": display_name,
|
1430
|
+
# "qualifiedName": qualified_name,
|
1431
|
+
# "description": description,
|
1432
|
+
# "language": language,
|
1433
|
+
# "usage": usage,
|
1434
|
+
# "category": category
|
1435
|
+
# },
|
1436
|
+
# }
|
1437
|
+
# response = self.create_collection(body=body)
|
1438
|
+
# return response
|
1436
1439
|
|
1437
1440
|
@dynamic_catch
|
1438
1441
|
async def _async_create_data_spec_collection(self, display_name: str = None, description: str = None,
|
@@ -5091,11 +5094,11 @@ class CollectionManager(Client2):
|
|
5091
5094
|
loop = asyncio.get_event_loop()
|
5092
5095
|
loop.run_until_complete(self._async_add_to_collection(collection_guid, element_guid, body))
|
5093
5096
|
|
5094
|
-
def
|
5097
|
+
def add_term_to_folder(self, folder_guid: str, term_guid: str,
|
5095
5098
|
body: dict | NewRelationshipRequestBody = None) -> None:
|
5096
5099
|
"""Add a term to a category. The request body is optional."""
|
5097
5100
|
loop = asyncio.get_event_loop()
|
5098
|
-
loop.run_until_complete(self._async_add_to_collection(
|
5101
|
+
loop.run_until_complete(self._async_add_to_collection(folder_guid, term_guid, body))
|
5099
5102
|
|
5100
5103
|
|
5101
5104
|
@dynamic_catch
|
@@ -5322,7 +5325,7 @@ class CollectionManager(Client2):
|
|
5322
5325
|
#
|
5323
5326
|
|
5324
5327
|
|
5325
|
-
def remove_term_from_category(self,
|
5328
|
+
def remove_term_from_category(self, folder_guid: str, term_guid: str,
|
5326
5329
|
body: dict | DeleteRequestBody= None) -> None:
|
5327
5330
|
"""Remove a term from a category.
|
5328
5331
|
|
@@ -5354,7 +5357,7 @@ class CollectionManager(Client2):
|
|
5354
5357
|
|
5355
5358
|
"""
|
5356
5359
|
loop = asyncio.get_event_loop()
|
5357
|
-
loop.run_until_complete(self._async_remove_from_collection(
|
5360
|
+
loop.run_until_complete(self._async_remove_from_collection(folder_guid, term_guid, body))
|
5358
5361
|
|
5359
5362
|
#
|
5360
5363
|
#
|
@@ -444,7 +444,7 @@ def load_app_config(env_file: str = None):
|
|
444
444
|
return _app_config
|
445
445
|
|
446
446
|
|
447
|
-
def get_app_config(env_file: str = None):
|
447
|
+
def get_app_config(env_file: str = None)-> AppConfig:
|
448
448
|
"""
|
449
449
|
Provides access to the loaded application configuration.
|
450
450
|
Ensures config is loaded if not already (useful for testing or simple scripts).
|
@@ -465,6 +465,8 @@ def get_app_config(env_file: str = None):
|
|
465
465
|
return _app_config
|
466
466
|
|
467
467
|
|
468
|
+
|
469
|
+
|
468
470
|
def _parse_bool_env(env_var: str, default: bool) -> bool:
|
469
471
|
"""
|
470
472
|
Parse a boolean environment variable.
|
@@ -515,4 +517,7 @@ def _parse_list_env(env_var: str, default: List[str]) -> List[str]:
|
|
515
517
|
value = os.getenv(env_var)
|
516
518
|
if value:
|
517
519
|
return [item.strip() for item in value.split(',')]
|
518
|
-
return default
|
520
|
+
return default
|
521
|
+
|
522
|
+
|
523
|
+
settings = get_app_config()
|
pyegeria/data_designer.py
CHANGED
@@ -21,7 +21,6 @@ from pyegeria.models import (SearchStringRequestBody, FilterRequestBody, GetRequ
|
|
21
21
|
from pyegeria.output_formatter import (extract_mermaid_only, extract_basic_dict)
|
22
22
|
from pyegeria.output_formatter import (generate_output,
|
23
23
|
_extract_referenceable_properties)
|
24
|
-
from pyegeria.output_formatter import (populate_columns_from_properties, get_required_relationships)
|
25
24
|
from pyegeria.utils import body_slimmer, dynamic_catch
|
26
25
|
|
27
26
|
|
@@ -4683,136 +4682,118 @@ class DataDesigner(Client2):
|
|
4683
4682
|
|
4684
4683
|
|
4685
4684
|
|
4686
|
-
def _extract_data_structure_properties(self, element: dict
|
4685
|
+
def _extract_data_structure_properties(self, element: dict) -> dict:
|
4687
4686
|
"""
|
4688
|
-
|
4687
|
+
Extract common properties from a data structure element.
|
4689
4688
|
|
4690
|
-
|
4691
|
-
|
4692
|
-
|
4693
|
-
|
4694
|
-
|
4689
|
+
Args:
|
4690
|
+
element (dict): The data structure element
|
4691
|
+
|
4692
|
+
Returns:
|
4693
|
+
dict: Dictionary of extracted properties
|
4694
|
+
"""
|
4695
|
+
props = _extract_referenceable_properties(element)
|
4696
|
+
|
4697
|
+
props['properties'] = element.get('properties', {})
|
4698
|
+
|
4699
|
+
props['namespace'] = props['properties'].get("namespace", "") or ""
|
4700
|
+
|
4701
|
+
classification_names = []
|
4702
|
+
for c in props['classifications']:
|
4703
|
+
classification_names.append(c.get("classificationName", None))
|
4704
|
+
props['classifications'] = classification_names
|
4705
|
+
|
4706
|
+
# Now lets get the related elements
|
4707
|
+
associated_elements = self.get_data_rel_elements_dict(element)
|
4708
|
+
props['data_specs'] = associated_elements.get("member_of_data_spec_qnames", [])
|
4709
|
+
|
4710
|
+
# data_structures = associated_elements.get("member_of_data_struct_qnames", [])
|
4711
|
+
props['assigned_meanings'] = associated_elements.get("assigned_meanings_qnames", [])
|
4712
|
+
props['parent_names'] = associated_elements.get("parent_qnames", [])
|
4713
|
+
props['member_data_fields'] = associated_elements.get("member_data_field_qnames", [])
|
4695
4714
|
|
4696
|
-
|
4697
|
-
|
4698
|
-
|
4699
|
-
|
4700
|
-
|
4701
|
-
|
4702
|
-
|
4703
|
-
|
4704
|
-
|
4705
|
-
|
4706
|
-
|
4707
|
-
|
4708
|
-
|
4709
|
-
|
4710
|
-
|
4711
|
-
|
4712
|
-
|
4713
|
-
|
4714
|
-
|
4715
|
-
|
4716
|
-
|
4717
|
-
|
4718
|
-
|
4719
|
-
|
4720
|
-
|
4721
|
-
|
4722
|
-
|
4723
|
-
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4727
|
-
|
4728
|
-
|
4729
|
-
|
4730
|
-
|
4731
|
-
|
4732
|
-
|
4733
|
-
|
4734
|
-
|
4735
|
-
|
4736
|
-
|
4737
|
-
|
4738
|
-
|
4739
|
-
|
4740
|
-
|
4741
|
-
|
4742
|
-
|
4743
|
-
|
4744
|
-
|
4745
|
-
|
4746
|
-
|
4747
|
-
|
4748
|
-
|
4749
|
-
|
4750
|
-
|
4751
|
-
|
4752
|
-
|
4753
|
-
|
4754
|
-
|
4755
|
-
|
4756
|
-
|
4757
|
-
|
4758
|
-
|
4759
|
-
|
4760
|
-
|
4761
|
-
|
4762
|
-
|
4763
|
-
|
4764
|
-
|
4765
|
-
|
4766
|
-
|
4767
|
-
|
4768
|
-
|
4769
|
-
|
4770
|
-
|
4771
|
-
|
4772
|
-
|
4773
|
-
|
4774
|
-
|
4775
|
-
|
4776
|
-
|
4777
|
-
|
4778
|
-
Populate columns_struct values for a Data Field element using the standardized approach.
|
4779
|
-
|
4780
|
-
Populates from properties, overlays header values, derives classifications, uses
|
4781
|
-
get_required_relationships for relationships, and adds mermaid graph.
|
4782
|
-
"""
|
4783
|
-
col_data = populate_columns_from_properties(element, columns_struct)
|
4784
|
-
columns_list = col_data.get("formats", {}).get("columns", [])
|
4785
|
-
|
4786
|
-
header_props = _extract_referenceable_properties(element)
|
4787
|
-
for column in columns_list:
|
4788
|
-
key = column.get('key')
|
4789
|
-
if key in header_props:
|
4790
|
-
column['value'] = header_props.get(key)
|
4791
|
-
elif isinstance(key, str) and key.lower() == 'guid':
|
4792
|
-
column['value'] = header_props.get('GUID')
|
4793
|
-
|
4794
|
-
# Classifications from header
|
4795
|
-
cl_names = []
|
4796
|
-
for c in element.get('elementHeader', {}).get('classifications', []) or []:
|
4797
|
-
nm = c.get('classificationName')
|
4798
|
-
if nm:
|
4799
|
-
cl_names.append(nm)
|
4800
|
-
if cl_names:
|
4801
|
-
for column in columns_list:
|
4802
|
-
if column.get('key') == 'classifications':
|
4803
|
-
column['value'] = ", ".join(cl_names)
|
4804
|
-
break
|
4805
|
-
|
4806
|
-
# Relationships and mermaid
|
4807
|
-
col_data = get_required_relationships(element, col_data)
|
4808
|
-
|
4809
|
-
mermaid_val = element.get('mermaidGraph', "") or ""
|
4810
|
-
for column in columns_list:
|
4811
|
-
if column.get('key') == 'mermaid':
|
4812
|
-
column['value'] = mermaid_val
|
4813
|
-
break
|
4814
|
-
|
4815
|
-
return col_data
|
4715
|
+
props['mermaid'] = element.get('mermaidGraph', "") or ""
|
4716
|
+
|
4717
|
+
return props
|
4718
|
+
|
4719
|
+
def _extract_data_class_properties(self, element: dict) -> dict:
|
4720
|
+
"""
|
4721
|
+
Extract common properties from a data class element.
|
4722
|
+
|
4723
|
+
Args:
|
4724
|
+
element (dict): The data class element
|
4725
|
+
|
4726
|
+
Returns:
|
4727
|
+
dict: Dictionary of extracted properties
|
4728
|
+
"""
|
4729
|
+
props = _extract_referenceable_properties(element)
|
4730
|
+
properties = element.get('properties', {})
|
4731
|
+
props['properties'] = properties
|
4732
|
+
|
4733
|
+
classification_names = []
|
4734
|
+
for c in props['classifications']:
|
4735
|
+
classification_names.append(c.get("classificationName", None))
|
4736
|
+
props['classifications'] = classification_names
|
4737
|
+
|
4738
|
+
props['namespace'] = props['properties'].get("namespace", "") or ""
|
4739
|
+
|
4740
|
+
props['data_type'] = properties.get('dataType', "") or ""
|
4741
|
+
props['match_property_names'] = properties.get('matchPropertyNames', []) or []
|
4742
|
+
props['match_threshold'] = properties.get('matchThreshold', 0)
|
4743
|
+
props['allow_duplicate_values'] = properties.get('allowDuplicateValues', False)
|
4744
|
+
props['is_case_sensitive'] = properties.get('isCaseSensitive', False)
|
4745
|
+
props['is_nullable'] = properties.get('isNullable', False)
|
4746
|
+
|
4747
|
+
# Now lets get the related elements
|
4748
|
+
associated_elements = self.get_data_rel_elements_dict(element)
|
4749
|
+
props['data_dictionaries'] = associated_elements.get("member_of_data_dicts_qnames", [])
|
4750
|
+
props['assigned_meanings'] = associated_elements.get("assigned_meanings_qnames", [])
|
4751
|
+
props['parent_names'] = associated_elements.get("parent_qnames", [])
|
4752
|
+
props['nested_data_classes'] = associated_elements.get("nested_data_class_qnames", [])
|
4753
|
+
props['specialized_data_classes'] = associated_elements.get("specialized_data_class_qnames", [])
|
4754
|
+
props['mermaid'] = element.get('mermaidGraph', "") or ""
|
4755
|
+
|
4756
|
+
return props
|
4757
|
+
|
4758
|
+
def _extract_data_field_properties(self, element: dict) -> dict:
|
4759
|
+
"""
|
4760
|
+
Extract common properties from a data field element.
|
4761
|
+
|
4762
|
+
Args:
|
4763
|
+
element (dict): The data field element
|
4764
|
+
|
4765
|
+
Returns:
|
4766
|
+
dict: Dictionary of extracted properties
|
4767
|
+
"""
|
4768
|
+
props = _extract_referenceable_properties(element)
|
4769
|
+
|
4770
|
+
props['properties'] = element.get('properties', {})
|
4771
|
+
props['namespace'] = props['properties'].get("namespace", "") or ""
|
4772
|
+
properties = element.get('properties', {})
|
4773
|
+
|
4774
|
+
classification_names = []
|
4775
|
+
for c in props['classifications']:
|
4776
|
+
classification_names.append(c.get("classificationName", None))
|
4777
|
+
props['classifications'] = classification_names
|
4778
|
+
|
4779
|
+
props['is_nullable'] = properties.get('isNullable', False)
|
4780
|
+
props['data_type'] = properties.get('dataType', "") or ""
|
4781
|
+
props['minimum_length'] = properties.get('minimumLength', 0)
|
4782
|
+
props['length'] = properties.get('length', 0)
|
4783
|
+
props['precision'] = properties.get('precision', 0)
|
4784
|
+
props['ordered_values'] = properties.get('orderedValues', False)
|
4785
|
+
props['sort_order'] = properties.get('sortOrder', "") or ""
|
4786
|
+
|
4787
|
+
# Now lets get the related elements
|
4788
|
+
associated_elements = self.get_data_rel_elements_dict(element)
|
4789
|
+
props['data_dictionaries'] = associated_elements.get("member_of_data_dicts_qnames", [])
|
4790
|
+
props['data_structures'] = associated_elements.get("data_structure_qnames", [])
|
4791
|
+
props['assigned_meanings'] = associated_elements.get("assigned_meanings_qnames", [])
|
4792
|
+
props['parent_names'] = associated_elements.get("parent_qnames", [])
|
4793
|
+
props['data_class'] = associated_elements.get("data_class_qnames", [])
|
4794
|
+
props['mermaid'] = element.get('mermaidGraph', "") or ""
|
4795
|
+
|
4796
|
+
return props
|
4816
4797
|
|
4817
4798
|
def _generate_basic_structured_output(self, elements: dict, filter: str, output_format: str,
|
4818
4799
|
columns_struct: dict = None) -> str | list:
|
@@ -4857,7 +4838,6 @@ class DataDesigner(Client2):
|
|
4857
4838
|
)
|
4858
4839
|
|
4859
4840
|
def _generate_data_structure_output(self, elements: dict | list[dict], filter: str = None,
|
4860
|
-
element_type_name: str | None = None,
|
4861
4841
|
output_format: str = "DICT",
|
4862
4842
|
output_format_set: str | dict = None) -> str | list:
|
4863
4843
|
"""
|
@@ -4866,43 +4846,33 @@ class DataDesigner(Client2):
|
|
4866
4846
|
Args:
|
4867
4847
|
elements: Dictionary or list of dictionaries containing data structure elements
|
4868
4848
|
filter: The search string used to find the elements
|
4869
|
-
element_type_name: Optional specific subtype name to drive output format selection
|
4870
4849
|
output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID, HTML)
|
4871
4850
|
|
4872
4851
|
Returns:
|
4873
4852
|
Formatted output as string or list of dictionaries
|
4874
4853
|
"""
|
4875
|
-
entity_type =
|
4854
|
+
entity_type = "Data Structure"
|
4855
|
+
if output_format_set is None:
|
4856
|
+
output_format_set = select_output_format_set(entity_type, output_format)
|
4876
4857
|
|
4877
|
-
# First see if the user has specified an output_format_set - either a label or a dict
|
4878
4858
|
if output_format_set:
|
4879
4859
|
if isinstance(output_format_set, str):
|
4880
4860
|
output_formats = select_output_format_set(output_format_set, output_format)
|
4881
|
-
|
4861
|
+
if isinstance(output_format_set, dict):
|
4882
4862
|
output_formats = get_output_format_type_match(output_format_set, output_format)
|
4883
|
-
# If no output_format was set, then use the element_type_name to lookup the output format
|
4884
|
-
elif element_type_name:
|
4885
|
-
output_formats = select_output_format_set(element_type_name, output_format)
|
4886
4863
|
else:
|
4887
|
-
|
4888
|
-
output_formats = select_output_format_set(entity_type, output_format)
|
4889
|
-
if output_formats is None:
|
4890
|
-
output_formats = select_output_format_set("Default", output_format)
|
4891
|
-
|
4864
|
+
output_formats = None
|
4892
4865
|
logger.trace(f"Executing _generate_data_structure_output for {entity_type}: {output_formats}")
|
4893
|
-
return generate_output(
|
4894
|
-
|
4895
|
-
|
4896
|
-
|
4897
|
-
|
4898
|
-
|
4899
|
-
|
4900
|
-
|
4901
|
-
|
4902
|
-
|
4903
|
-
def _generate_data_class_output(self, elements: dict | list[dict], filter: str = None,
|
4904
|
-
element_type_name: str | None = None,
|
4905
|
-
output_format: str = "DICT",
|
4866
|
+
return generate_output(elements,
|
4867
|
+
filter,
|
4868
|
+
entity_type,
|
4869
|
+
output_format,
|
4870
|
+
self._extract_data_structure_properties,
|
4871
|
+
None,
|
4872
|
+
output_formats,
|
4873
|
+
)
|
4874
|
+
|
4875
|
+
def _generate_data_class_output(self, elements: dict | list[dict], filter: str = None, output_format: str = "DICT",
|
4906
4876
|
output_format_set: str | dict = None) -> str | list:
|
4907
4877
|
"""
|
4908
4878
|
Generate output for data classes in the specified format.
|
@@ -4910,40 +4880,34 @@ class DataDesigner(Client2):
|
|
4910
4880
|
Args:
|
4911
4881
|
elements: Dictionary or list of dictionaries containing data class elements
|
4912
4882
|
filter: The search string used to find the elements
|
4913
|
-
element_type_name: Optional specific subtype name to drive output format selection
|
4914
4883
|
output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID, HTML)
|
4915
4884
|
output_format_set: Optional output format set
|
4916
4885
|
- Option column/attribute selection and definition.
|
4917
4886
|
Returns:
|
4918
4887
|
Formatted output as either a string or list of dictionaries
|
4919
4888
|
"""
|
4920
|
-
entity_type =
|
4889
|
+
entity_type = "Data Class"
|
4890
|
+
if output_format_set is None:
|
4891
|
+
output_format_set = select_output_format_set(entity_type, output_format)
|
4892
|
+
|
4921
4893
|
if output_format_set:
|
4922
4894
|
if isinstance(output_format_set, str):
|
4923
4895
|
output_formats = select_output_format_set(output_format_set, output_format)
|
4924
|
-
|
4896
|
+
if isinstance(output_format_set, dict):
|
4925
4897
|
output_formats = get_output_format_type_match(output_format_set, output_format)
|
4926
|
-
elif element_type_name:
|
4927
|
-
output_formats = select_output_format_set(element_type_name, output_format)
|
4928
4898
|
else:
|
4929
|
-
output_formats =
|
4930
|
-
if output_formats is None:
|
4931
|
-
output_formats = select_output_format_set("Default", output_format)
|
4932
|
-
|
4899
|
+
output_formats = None
|
4933
4900
|
logger.trace(f"Executing _generate_data_class_output for {entity_type}: {output_formats}")
|
4934
|
-
return generate_output(
|
4935
|
-
|
4936
|
-
|
4937
|
-
|
4938
|
-
|
4939
|
-
|
4940
|
-
|
4941
|
-
|
4942
|
-
|
4943
|
-
|
4944
|
-
def _generate_data_field_output(self, elements: dict | list[dict], filter: str = None,
|
4945
|
-
element_type_name: str | None = None,
|
4946
|
-
output_format: str = "DICT",
|
4901
|
+
return generate_output(elements,
|
4902
|
+
filter,
|
4903
|
+
entity_type,
|
4904
|
+
output_format,
|
4905
|
+
self._extract_data_class_properties,
|
4906
|
+
None,
|
4907
|
+
output_formats,
|
4908
|
+
)
|
4909
|
+
|
4910
|
+
def _generate_data_field_output(self, elements: dict | list[dict], filter: str = None, output_format: str = "DICT",
|
4947
4911
|
output_format_set: str | dict = None) -> str | list:
|
4948
4912
|
"""
|
4949
4913
|
Generate output for data fields in the specified format.
|
@@ -4951,7 +4915,6 @@ class DataDesigner(Client2):
|
|
4951
4915
|
Args:
|
4952
4916
|
elements: Dictionary or list of dictionaries containing data field elements
|
4953
4917
|
filter: The search string used to find the elements
|
4954
|
-
element_type_name: Optional specific subtype name to drive output format selection
|
4955
4918
|
output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID, HTML)
|
4956
4919
|
output_format_set: str|dict, Optional, default = None
|
4957
4920
|
- Option column/attribute selection and definition.
|
@@ -4959,29 +4922,26 @@ class DataDesigner(Client2):
|
|
4959
4922
|
Returns:
|
4960
4923
|
Formatted output as a string or list of dictionaries
|
4961
4924
|
"""
|
4962
|
-
entity_type =
|
4925
|
+
entity_type = "Data Field"
|
4926
|
+
if output_format_set is None:
|
4927
|
+
output_format_set = select_output_format_set(entity_type, output_format)
|
4928
|
+
|
4963
4929
|
if output_format_set:
|
4964
4930
|
if isinstance(output_format_set, str):
|
4965
4931
|
output_formats = select_output_format_set(output_format_set, output_format)
|
4966
|
-
|
4932
|
+
if isinstance(output_format_set, dict):
|
4967
4933
|
output_formats = get_output_format_type_match(output_format_set, output_format)
|
4968
|
-
elif element_type_name:
|
4969
|
-
output_formats = select_output_format_set(element_type_name, output_format)
|
4970
4934
|
else:
|
4971
|
-
output_formats =
|
4972
|
-
if output_formats is None:
|
4973
|
-
output_formats = select_output_format_set("Default", output_format)
|
4974
|
-
|
4935
|
+
output_formats = None
|
4975
4936
|
logger.trace(f"Executing _generate_data_field_output for {entity_type}: {output_formats}")
|
4976
|
-
return generate_output(
|
4977
|
-
|
4978
|
-
|
4979
|
-
|
4980
|
-
|
4981
|
-
|
4982
|
-
|
4983
|
-
|
4984
|
-
)
|
4937
|
+
return generate_output(elements,
|
4938
|
+
filter,
|
4939
|
+
entity_type,
|
4940
|
+
output_format,
|
4941
|
+
self._extract_data_field_properties,
|
4942
|
+
None,
|
4943
|
+
output_formats,
|
4944
|
+
)
|
4985
4945
|
|
4986
4946
|
|
4987
4947
|
if __name__ == "__main__":
|