pyegeria 5.3.9.9.7__py3-none-any.whl → 5.4.0.dev2__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.2025-06-05_20-24-18_123924.log.zip +0 -0
- commands/cat/debug_log.2025-06-10_08-45-03_929921.log.zip +0 -0
- commands/cat/debug_log.2025-06-11_09-57-21_247890.log.zip +0 -0
- commands/cat/debug_log.2025-06-12_16-14-31_212042.log.zip +0 -0
- commands/cat/dr_egeria_md.py +32 -5
- commands/cat/list_collections.py +10 -4
- commands/cat/list_data_designer.py +171 -0
- md_processing/__init__.py +7 -2
- md_processing/data/commands.json +4666 -848
- md_processing/md_commands/data_designer_commands.py +840 -557
- md_processing/md_commands/solution_architect_commands.py +985 -0
- md_processing/md_processing_utils/common_md_proc_utils.py +262 -89
- md_processing/md_processing_utils/common_md_utils.py +11 -4
- md_processing/md_processing_utils/md_processing_constants.py +18 -16
- pyegeria/_client.py +39 -0
- pyegeria/classification_manager_omvs.py +1 -1
- pyegeria/collection_manager_omvs.py +248 -188
- pyegeria/data_designer_omvs.py +217 -9
- pyegeria/governance_officer_omvs.py +2349 -0
- pyegeria/output_formatter.py +24 -12
- pyegeria/solution_architect_omvs.py +4219 -1084
- pyegeria/utils.py +15 -2
- {pyegeria-5.3.9.9.7.dist-info → pyegeria-5.4.0.dev2.dist-info}/METADATA +2 -1
- {pyegeria-5.3.9.9.7.dist-info → pyegeria-5.4.0.dev2.dist-info}/RECORD +27 -62
- {pyegeria-5.3.9.9.7.dist-info → pyegeria-5.4.0.dev2.dist-info}/entry_points.txt +3 -0
- commands/cat/.DS_Store +0 -0
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro.md +0 -254
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_more_terms.md +0 -696
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part1.md +0 -254
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part2.md +0 -298
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part3.md +0 -608
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part4.md +0 -94
- md_processing/dr_egeria_inbox/archive/freddie_intro.md +0 -284
- md_processing/dr_egeria_inbox/archive/freddie_intro_orig.md +0 -275
- md_processing/dr_egeria_inbox/archive/test-term.md +0 -110
- md_processing/dr_egeria_inbox/cat_test.md +0 -100
- md_processing/dr_egeria_inbox/data_field.md +0 -54
- md_processing/dr_egeria_inbox/data_spec.md +0 -77
- md_processing/dr_egeria_inbox/data_spec_test.md +0 -2406
- md_processing/dr_egeria_inbox/data_test.md +0 -86
- md_processing/dr_egeria_inbox/dr_egeria_intro_categories.md +0 -168
- md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +0 -280
- md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +0 -313
- md_processing/dr_egeria_inbox/dr_egeria_intro_part3.md +0 -1073
- md_processing/dr_egeria_inbox/dr_egeria_isc1.md +0 -44
- md_processing/dr_egeria_inbox/glossary_test1.md +0 -324
- md_processing/dr_egeria_inbox/rel.md +0 -8
- md_processing/dr_egeria_inbox/sb.md +0 -119
- md_processing/dr_egeria_inbox/search_test.md +0 -39
- md_processing/dr_egeria_inbox/solution-components.md +0 -154
- md_processing/dr_egeria_inbox/solution_blueprints.md +0 -118
- md_processing/dr_egeria_inbox/synonym_test.md +0 -42
- md_processing/dr_egeria_inbox/t1.md +0 -0
- md_processing/dr_egeria_inbox/t2.md +0 -268
- md_processing/dr_egeria_outbox/processed-2025-05-15 19:52-data_test.md +0 -94
- md_processing/dr_egeria_outbox/processed-2025-05-16 07:39-data_test.md +0 -88
- md_processing/dr_egeria_outbox/processed-2025-05-17 16:01-data_field.md +0 -56
- md_processing/dr_egeria_outbox/processed-2025-05-18 15:51-data_test.md +0 -103
- md_processing/dr_egeria_outbox/processed-2025-05-18 16:47-data_test.md +0 -94
- md_processing/dr_egeria_outbox/processed-2025-05-19 07:14-data_test.md +0 -96
- md_processing/dr_egeria_outbox/processed-2025-05-19 07:20-data_test.md +0 -100
- md_processing/dr_egeria_outbox/processed-2025-05-19 07:22-data_test.md +0 -88
- md_processing/dr_egeria_outbox/processed-2025-05-19 09:26-data_test.md +0 -91
- md_processing/dr_egeria_outbox/processed-2025-05-19 10:27-data_test.md +0 -91
- md_processing/dr_egeria_outbox/processed-2025-05-19 14:04-data_test.md +0 -91
- md_processing/md_commands/blueprint_commands.py +0 -303
- pyegeria/.DS_Store +0 -0
- {pyegeria-5.3.9.9.7.dist-info → pyegeria-5.4.0.dev2.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.9.9.7.dist-info → pyegeria-5.4.0.dev2.dist-info}/WHEEL +0 -0
pyegeria/data_designer_omvs.py
CHANGED
@@ -8,8 +8,10 @@ This module provides access to the data-designer OMVS module.
|
|
8
8
|
"""
|
9
9
|
|
10
10
|
import asyncio
|
11
|
+
from os import terminal_size
|
11
12
|
|
12
13
|
from httpx import Response
|
14
|
+
from prompt_toolkit import data_structures
|
13
15
|
|
14
16
|
from pyegeria._client import Client, max_paging_size
|
15
17
|
from pyegeria._globals import NO_ELEMENTS_FOUND
|
@@ -569,6 +571,176 @@ r replace_all_properties: bool, default = False
|
|
569
571
|
loop.run_until_complete(
|
570
572
|
self._async_update_data_structure_w_body(data_struct_guid, body, replace_all_properties))
|
571
573
|
|
574
|
+
def get_data_memberships(self, data_get_fcn: callable, data_struct_guid: str) -> dict | None:
|
575
|
+
data_structure_info = data_get_fcn(data_struct_guid, output_format="JSON")
|
576
|
+
if data_structure_info == "No elements found":
|
577
|
+
return None
|
578
|
+
collection_list = {"DictList": [], "SpecList": [], "CollectionDetails": []}
|
579
|
+
if isinstance(data_structure_info, (dict, list)):
|
580
|
+
member_of_collections = data_structure_info['memberOfCollections']
|
581
|
+
if isinstance(member_of_collections, list):
|
582
|
+
for member_rel in member_of_collections:
|
583
|
+
props = member_rel["relatedElement"]["properties"]
|
584
|
+
qname = props.get('qualifiedName', None)
|
585
|
+
guid = member_rel['relatedElement']['elementHeader']['guid']
|
586
|
+
description = props.get('description', None)
|
587
|
+
collection_type = props.get('collectionType', None)
|
588
|
+
if collection_type == "Data Dictionary":
|
589
|
+
collection_list["DictList"].append(guid)
|
590
|
+
elif collection_type == "Data Specification":
|
591
|
+
collection_list["SpecList"].append(guid)
|
592
|
+
collection_list["CollectionDetails"].append({"guid":guid, "description":description,
|
593
|
+
"collectionType":collection_type, "qualifiedName":qname})
|
594
|
+
else:
|
595
|
+
return None
|
596
|
+
return collection_list
|
597
|
+
else:
|
598
|
+
return None
|
599
|
+
|
600
|
+
def get_data_memberships_with_dict(self, data_field_elements: dict) -> dict:
|
601
|
+
collection_list = {"DictList_guid": [], "DictList_qn": [], "SpecList_guid": [], "SpecList_qn": [], "CollectionDetails": []}
|
602
|
+
if isinstance(data_field_elements, (dict, list)):
|
603
|
+
|
604
|
+
for member_rel in data_field_elements:
|
605
|
+
type_name = ""
|
606
|
+
props = member_rel["relatedElement"]["properties"]
|
607
|
+
qname = props.get('qualifiedName', None)
|
608
|
+
guid = member_rel['relatedElement']['elementHeader']['guid']
|
609
|
+
description = props.get('description', None)
|
610
|
+
collection_type = props.get('collectionType', None)
|
611
|
+
classifications = member_rel["relatedElement"]["elementHeader"]["classifications"]
|
612
|
+
for classification in classifications:
|
613
|
+
type_name = classification["type"]['typeName']
|
614
|
+
if type_name == "DataDictionary":
|
615
|
+
collection_list["DictList_guid"].append(guid)
|
616
|
+
collection_list["DictList_qn"].append(qname)
|
617
|
+
elif type_name == "DataSpec":
|
618
|
+
collection_list["SpecList_guid"].append(guid)
|
619
|
+
collection_list["SpecList_qn"].append(qname)
|
620
|
+
collection_list["CollectionDetails"].append({"typeName":type_name, "guid":guid, "description":description,
|
621
|
+
"collectionType": collection_type,
|
622
|
+
"qualifiedName": qname
|
623
|
+
})
|
624
|
+
return collection_list
|
625
|
+
|
626
|
+
|
627
|
+
def get_data_field_rel_elements_dict(self, field_struct: dict)-> dict | str:
|
628
|
+
"""return the lists of objects related to a data field"""
|
629
|
+
|
630
|
+
parent_guids = []
|
631
|
+
parent_names = []
|
632
|
+
parent_qnames = []
|
633
|
+
|
634
|
+
data_structure_guids = []
|
635
|
+
data_structure_names = []
|
636
|
+
data_structure_qnames = []
|
637
|
+
|
638
|
+
assigned_meanings_guids = []
|
639
|
+
assigned_meanings_names = []
|
640
|
+
assigned_meanings_qnames = []
|
641
|
+
|
642
|
+
data_class_guids = []
|
643
|
+
data_class_names = []
|
644
|
+
data_class_qnames = []
|
645
|
+
|
646
|
+
external_references_guids = []
|
647
|
+
external_references_names = []
|
648
|
+
external_references_qnames = []
|
649
|
+
|
650
|
+
member_of_data_dicts_guids = []
|
651
|
+
member_of_data_dicts_names = []
|
652
|
+
member_of_data_dicts_qnames = []
|
653
|
+
|
654
|
+
member_of_data_spec_guids = []
|
655
|
+
member_of_data_spec_names = []
|
656
|
+
member_of_data_specs_qnames = []
|
657
|
+
|
658
|
+
|
659
|
+
# terms
|
660
|
+
assigned_meanings = field_struct["assignedMeanings"]
|
661
|
+
for meaning in assigned_meanings:
|
662
|
+
assigned_meanings_guids.append(meaning['relatedElement']['elementHeader']['guid'])
|
663
|
+
assigned_meanings_names.append(meaning['relatedElement']['properties']['displayName'])
|
664
|
+
assigned_meanings_qnames.append(meaning['relatedElement']['properties']['qualifiedName'])
|
665
|
+
|
666
|
+
|
667
|
+
# extract existing related data structure and data field elements
|
668
|
+
other_related_elements = field_struct["otherRelatedElements"]
|
669
|
+
|
670
|
+
for rel in other_related_elements:
|
671
|
+
related_element = rel["relatedElement"]
|
672
|
+
type = related_element["elementHeader"]["type"]["typeName"]
|
673
|
+
guid = related_element["elementHeader"]["guid"]
|
674
|
+
qualified_name = related_element["properties"].get("qualifiedName","") or ""
|
675
|
+
display_name = related_element["properties"].get("displayName","") or ""
|
676
|
+
if type == "DataStructure":
|
677
|
+
data_structure_guids.append(guid)
|
678
|
+
data_structure_names.append(display_name)
|
679
|
+
data_structure_qnames.append(qualified_name)
|
680
|
+
|
681
|
+
elif type == "DataField":
|
682
|
+
parent_guids.append(guid)
|
683
|
+
parent_names.append(display_name)
|
684
|
+
parent_qnames.append(qualified_name)
|
685
|
+
|
686
|
+
|
687
|
+
member_of_collections = field_struct["memberOfCollections"]
|
688
|
+
for collection in member_of_collections:
|
689
|
+
c_type = collection["relatedElement"]["properties"].get("collectionType","") or ""
|
690
|
+
guid = collection["relatedElement"]["elementHeader"]["guid"]
|
691
|
+
name = collection["relatedElement"]["properties"].get("name","") or ""
|
692
|
+
qualifiedName = collection['relatedElement']["properties"].get("qualifiedName","") or ""
|
693
|
+
classifications = collection["relatedElement"]["elementHeader"]["classifications"]
|
694
|
+
for classification in classifications:
|
695
|
+
type_name = classification["type"]['typeName']
|
696
|
+
if type_name == "DataDictionary":
|
697
|
+
member_of_data_dicts_guids.append(guid)
|
698
|
+
member_of_data_dicts_names.append(name)
|
699
|
+
member_of_data_dicts_qnames.append(qualifiedName)
|
700
|
+
elif type_name == "DataSpec":
|
701
|
+
member_of_data_spec_guids.append(guid)
|
702
|
+
member_of_data_spec_names.append(name)
|
703
|
+
member_of_data_specs_qnames.append(qualifiedName)
|
704
|
+
|
705
|
+
return {"parent_guids": parent_guids,
|
706
|
+
"parent_names": parent_names,
|
707
|
+
"parent_qnames": parent_qnames,
|
708
|
+
|
709
|
+
"data_structure_guids": data_structure_guids,
|
710
|
+
"data_structure_names": data_structure_names,
|
711
|
+
"data_structure_qnames": data_structure_qnames,
|
712
|
+
|
713
|
+
"assigned_meanings_guids": assigned_meanings_guids,
|
714
|
+
"assigned_meanings_names": assigned_meanings_names,
|
715
|
+
"assigned_meanings_qnames": assigned_meanings_qnames,
|
716
|
+
|
717
|
+
"data_class_guids": data_class_guids,
|
718
|
+
"data_class_names": data_class_names,
|
719
|
+
"data_class_qnames": data_class_qnames,
|
720
|
+
|
721
|
+
"external_references_guids": external_references_guids,
|
722
|
+
"external_references_names": external_references_names,
|
723
|
+
"external_references_qnames": external_references_qnames,
|
724
|
+
|
725
|
+
"member_of_data_dicts_guids": member_of_data_dicts_guids,
|
726
|
+
"member_of_data_dicts_names": member_of_data_dicts_names,
|
727
|
+
"member_of_data_dicts_qnames": member_of_data_dicts_qnames,
|
728
|
+
|
729
|
+
"member_of_data_spec_guids": member_of_data_spec_guids,
|
730
|
+
"member_of_data_spec_names": member_of_data_spec_names,
|
731
|
+
"member_of_data_specs_qnames": member_of_data_specs_qnames,
|
732
|
+
}
|
733
|
+
|
734
|
+
|
735
|
+
def get_data_field_rel_elements(self, guid:str)-> dict | str:
|
736
|
+
"""return the lists of objects related to a data field"""
|
737
|
+
|
738
|
+
data_field_entry = self.get_data_field_by_guid(guid, output_format="JSON")
|
739
|
+
if isinstance(data_field_entry, str):
|
740
|
+
return NO_ELEMENTS_FOUND
|
741
|
+
return self.get_data_field_rel_elements_dict(data_field_entry)
|
742
|
+
|
743
|
+
|
572
744
|
async def _async_link_member_data_field(self, parent_data_struct_guid: str, member_data_field_guid: str,
|
573
745
|
body: dict = None) -> None:
|
574
746
|
"""
|
@@ -1125,6 +1297,8 @@ r replace_all_properties: bool, default = False
|
|
1125
1297
|
the requesting user is not authorized to issue this request.
|
1126
1298
|
|
1127
1299
|
"""
|
1300
|
+
if filter == "*":
|
1301
|
+
filter = None
|
1128
1302
|
|
1129
1303
|
body = {"filter": filter}
|
1130
1304
|
starts_with_s = str(starts_with).lower()
|
@@ -1918,9 +2092,9 @@ r replace_all_properties: bool, default = False
|
|
1918
2092
|
Parameters
|
1919
2093
|
----------
|
1920
2094
|
parent_data_field_guid: str
|
1921
|
-
- the GUID of the parent data
|
2095
|
+
- the GUID of the parent data field the nested data field will be connected to.
|
1922
2096
|
nested_data_field_guid: str
|
1923
|
-
- the GUID of the nested data
|
2097
|
+
- the GUID of the nested data field to be connected.
|
1924
2098
|
body: dict, optional
|
1925
2099
|
- a dictionary containing additional properties.
|
1926
2100
|
|
@@ -1977,9 +2151,9 @@ r replace_all_properties: bool, default = False
|
|
1977
2151
|
Parameters
|
1978
2152
|
----------
|
1979
2153
|
parent_data_field_guid: str
|
1980
|
-
- the GUID of the parent data
|
2154
|
+
- the GUID of the parent data field the nested data field will be connected to.
|
1981
2155
|
nested_data_field_guid: str
|
1982
|
-
- the GUID of the nested data
|
2156
|
+
- the GUID of the nested data field to be connected.
|
1983
2157
|
body: dict, optional
|
1984
2158
|
- a dictionary containing additional properties.
|
1985
2159
|
|
@@ -2708,7 +2882,7 @@ r replace_all_properties: bool, default = False
|
|
2708
2882
|
if type(elements) is str:
|
2709
2883
|
return NO_ELEMENTS_FOUND
|
2710
2884
|
if output_format != 'JSON': # return other representations
|
2711
|
-
return self.generate_data_field_output(elements,
|
2885
|
+
return self.generate_data_field_output(elements, None, output_format)
|
2712
2886
|
return elements
|
2713
2887
|
|
2714
2888
|
def get_data_field_by_guid(self, guid: str, body: str = None, output_format: str = "DICT") -> list | str:
|
@@ -4944,6 +5118,17 @@ r replace_all_properties: bool, default = False
|
|
4944
5118
|
namespace = properties.get("namespace", "") or ""
|
4945
5119
|
version_id = properties.get("versionIdentifier", "") or ""
|
4946
5120
|
|
5121
|
+
# Get data type from extendedProperties and additionalProperties if available
|
5122
|
+
extended_properties = properties.get("extendedProperties", {})
|
5123
|
+
additional_properties = properties.get("additionalProperties", {})
|
5124
|
+
|
5125
|
+
# Now lets get the related elements
|
5126
|
+
related_elements = self.get_data_field_rel_elements_dict(element)
|
5127
|
+
data_dictionaries = related_elements.get("member_of_data_dicts_qnames", [])
|
5128
|
+
data_structures = related_elements.get("data_structure_qnames", [])
|
5129
|
+
assigned_meanings = related_elements.get("assigned_meanings_qnames", [])
|
5130
|
+
parent_names = related_elements.get("parent_qnames", [])
|
5131
|
+
|
4947
5132
|
return {
|
4948
5133
|
'guid': guid, 'properties': properties, 'display_name': display_name, 'description': description,
|
4949
5134
|
'qualified_name': qualified_name, 'namespace': namespace, 'version_identifier': version_id
|
@@ -4986,13 +5171,33 @@ r replace_all_properties: bool, default = False
|
|
4986
5171
|
description = properties.get("description", "") or ""
|
4987
5172
|
qualified_name = properties.get("qualifiedName", "") or ""
|
4988
5173
|
|
4989
|
-
|
5174
|
+
is_nullable = properties.get('isNullable', False)
|
5175
|
+
data_type = properties.get('dataType', "") or ""
|
5176
|
+
minimum_length = properties.get('minimumLength', 0)
|
5177
|
+
length = properties.get('length', 0)
|
5178
|
+
precision = properties.get('precision', 0)
|
5179
|
+
ordered_values = properties.get('orderedValues', False)
|
5180
|
+
sort_order = properties.get('sortOrder', "") or ""
|
5181
|
+
|
5182
|
+
|
5183
|
+
|
5184
|
+
# Get data type from extendedProperties and additionalProperties if available
|
4990
5185
|
extended_properties = properties.get("extendedProperties", {})
|
4991
|
-
|
5186
|
+
additional_properties = properties.get("additionalProperties", {})
|
5187
|
+
|
5188
|
+
# Now lets get the related elements
|
5189
|
+
related_elements = self.get_data_field_rel_elements_dict(element)
|
5190
|
+
data_dictionaries = related_elements.get("member_of_data_dicts_qnames",[])
|
5191
|
+
data_structures = related_elements.get("data_structure_qnames",[])
|
5192
|
+
assigned_meanings = related_elements.get("assigned_meanings_qnames",[])
|
5193
|
+
parent_names = related_elements.get("parent_qnames",[])
|
4992
5194
|
|
4993
5195
|
return {
|
4994
|
-
'
|
4995
|
-
'qualified_name': qualified_name, 'data_type': data_type
|
5196
|
+
'display_name': display_name, 'description': description, 'assigned_meanings': assigned_meanings,
|
5197
|
+
'qualified_name': qualified_name, 'data_type': data_type, 'guid': guid, 'properties': properties,
|
5198
|
+
'is_nullable': is_nullable, 'minimum_length': minimum_length, 'length': length, 'precision': precision,
|
5199
|
+
'ordered_values': ordered_values, 'sort_order': sort_order, 'parent_names': parent_names, 'extended_properties': extended_properties,
|
5200
|
+
'additional_properties': additional_properties,'data_dictionaries': data_dictionaries, 'data_structures': data_structures
|
4996
5201
|
}
|
4997
5202
|
|
4998
5203
|
def generate_basic_structured_output(self, elements, filter, output_format) -> str | list:
|
@@ -5100,5 +5305,8 @@ r replace_all_properties: bool, default = False
|
|
5100
5305
|
return self.generate_basic_structured_output(elements, filter, output_format)
|
5101
5306
|
|
5102
5307
|
|
5308
|
+
|
5309
|
+
|
5310
|
+
|
5103
5311
|
if __name__ == "__main__":
|
5104
5312
|
print("Data Designer")
|