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
@@ -5,7 +5,7 @@ import os
|
|
5
5
|
import re
|
6
6
|
from datetime import datetime
|
7
7
|
from typing import Any
|
8
|
-
|
8
|
+
from loguru import logger
|
9
9
|
from rich import print
|
10
10
|
from rich.console import Console
|
11
11
|
from rich.markdown import Markdown
|
@@ -73,8 +73,8 @@ def print_msg(msg_level: str, msg: str, verbosity: str):
|
|
73
73
|
"""
|
74
74
|
if msg_level == "ALWAYS":
|
75
75
|
print(f"{message_types.get(msg_level, '')}{msg}")
|
76
|
-
else:
|
77
|
-
|
76
|
+
# else:
|
77
|
+
# logger.info(f"{message_types.get(msg_level, '')}{msg}")
|
78
78
|
# elif verbosity == "verbose" and msg_level in ["INFO", "WARNING", "ERROR"]:
|
79
79
|
# print(f"{message_types.get(msg_level, '')}{msg}")
|
80
80
|
# elif verbosity == "quiet" and msg_level in ["WARNING", "ERROR"]:
|
@@ -84,7 +84,14 @@ def print_msg(msg_level: str, msg: str, verbosity: str):
|
|
84
84
|
# print(f"{message_types.get(msg_level, '')}{msg}")
|
85
85
|
# elif verbosity == "display-only" and msg_level in ["ALWAYS", "ERROR"]:
|
86
86
|
# print(f"{message_types.get(msg_level, '')}{msg}")
|
87
|
-
|
87
|
+
elif msg_level == "ERROR":
|
88
|
+
logger.error(f"{message_types.get(msg_level, '')}{msg}")
|
89
|
+
elif msg_level == "WARNING":
|
90
|
+
logger.warning(f"{message_types.get(msg_level, '')}{msg}")
|
91
|
+
elif msg_level == "DEBUG":
|
92
|
+
logger.debug(f"{message_types.get(msg_level, '')}{msg}")
|
93
|
+
else:
|
94
|
+
logger.info(f"{message_types.get(msg_level, '')}{msg}")
|
88
95
|
|
89
96
|
def process_provenance_command(file_path: str, txt: [str]) -> str:
|
90
97
|
"""
|
@@ -1,19 +1,19 @@
|
|
1
1
|
"""
|
2
2
|
This file contains display-related constants and formatting functions for Egeria Markdown processing
|
3
3
|
"""
|
4
|
+
import importlib.resources
|
4
5
|
import json
|
5
6
|
import os
|
6
|
-
|
7
|
+
|
7
8
|
from rich.markdown import Markdown
|
8
9
|
|
10
|
+
from md_processing.md_processing_utils.message_constants import ERROR
|
9
11
|
from pyegeria._globals import DEBUG_LEVEL
|
10
12
|
from md_processing.md_processing_utils.message_constants import message_types, ALWAYS, ERROR, INFO, WARNING
|
11
13
|
|
12
14
|
EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", "/home/jovyan")
|
13
15
|
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "loading-bay/dr_egeria_inbox")
|
14
16
|
|
15
|
-
|
16
|
-
|
17
17
|
# Constants for element labels
|
18
18
|
GLOSSARY_NAME_LABELS = ["Glossary Name", "Glossary", "Glossaries", "Owning Glossary", "In Glossary"]
|
19
19
|
CATEGORY_NAME_LABELS = ["Glossary Category Name", "Glossary Category", "Glossary Categories", "Category Name",
|
@@ -43,18 +43,25 @@ ELEMENT_OUTPUT_FORMATS = ["LIST", "DICT", "MD", "FORM", "REPORT"]
|
|
43
43
|
|
44
44
|
# Constants for term relationships
|
45
45
|
TERM_RELATIONSHPS = ["Synonym", "Translation", "PreferredTerm", "TermISATYPEOFRelationship", "TermTYPEDBYRelationship",
|
46
|
-
|
46
|
+
"Antonym", "ReplacementTerm", "ValidValue", "TermHASARelationship", "RelatedTerm",
|
47
|
+
"ISARelationship"]
|
47
48
|
|
48
49
|
# List of supported md_commands
|
49
50
|
command_list = ["Provenance", "Create Glossary", "Update Glossary", "Create Term", "Update Term", "List Terms",
|
50
51
|
"List Term Details", "List Glossary Terms", "List Term History", "List Term Revision History",
|
51
52
|
"List Term Update History", "List Glossary Structure", "List Glossaries", "List Categories",
|
52
53
|
"List Glossary Categories", "Create Personal Project", "Update Personal Project", "Create Category",
|
53
|
-
"Update Category", "Create Solution Blueprint", "Update Solution Blueprint",
|
54
|
+
"Update Category", "Create Solution Blueprint", "Update Solution Blueprint", "View Solution Blueprint", "View Solution Blueprints", "View Blueprints",
|
55
|
+
"View Information Supply Chain", "View Information Supply Chains", "View Supply Chains", "View Supply Chain",
|
56
|
+
"View Solution Components", "View Solution Component", "View Solution Roles", "View Solution Role",
|
57
|
+
"Create Information Supply Chain", "Update Information Supply Chain",
|
58
|
+
"Create Information Supply Chain Segment", "Update Information Supply Chain Segment", "Link Segments", "Detach Segments",
|
54
59
|
"Create Solution Component", "Update Solution Component", "Create Term-Term Relationship",
|
55
|
-
"Update Term-Term Relationship","Create Data Spec", "Create Data Specification", "Update Data Spec",
|
56
|
-
"Update Data Specification"
|
57
|
-
"
|
60
|
+
"Update Term-Term Relationship", "Create Data Spec", "Create Data Specification", "Update Data Spec",
|
61
|
+
"Update Data Specification", "Create Data Field", "Update Data Field", "Create Data Structure",
|
62
|
+
"Update Data Structure", "Create Data Dictionary", "Update Data Dictionary", "Create Data Dict",
|
63
|
+
"Update Data Dict", " View Data Dictionary", "View Data Dictionaries", "Create Data Class", "Update Data Class",]
|
64
|
+
|
58
65
|
|
59
66
|
pre_command = "\n---\n==> Processing object_action:"
|
60
67
|
command_seperator = Markdown("\n---\n")
|
@@ -64,21 +71,14 @@ COMMAND_DEFINITIONS = {}
|
|
64
71
|
debug_level = DEBUG_LEVEL
|
65
72
|
|
66
73
|
|
67
|
-
|
68
74
|
def load_commands(filename: str) -> None:
|
69
75
|
global COMMAND_DEFINITIONS
|
70
|
-
# print("EGERIA_INBOX_PATH: ", EGERIA_INBOX_PATH)
|
71
|
-
|
72
|
-
# full_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_INBOX_PATH, filename)
|
73
76
|
|
74
|
-
# print("Loading commands from: ", full_file_path)
|
75
77
|
try:
|
76
78
|
config_path = importlib.resources.files("md_processing") / "data" / filename
|
77
79
|
config_str = config_path.read_text(encoding="utf-8")
|
78
80
|
COMMAND_DEFINITIONS = json.loads(config_str)
|
79
81
|
|
80
|
-
# with open(full_file_path, 'r') as file:
|
81
|
-
# COMMAND_DEFINITIONS = json.load(file)
|
82
82
|
except FileNotFoundError:
|
83
83
|
msg = f"ERROR: File {filename} not found."
|
84
84
|
print(ERROR, msg, debug_level)
|
@@ -94,16 +94,18 @@ def get_command_spec(command: str) -> dict | None:
|
|
94
94
|
if obj:
|
95
95
|
return COMMAND_DEFINITIONS.get('Command Specifications', {}).get(obj, None)
|
96
96
|
|
97
|
+
|
97
98
|
def find_alternate_names(command: str) -> str | None:
|
98
99
|
global COMMAND_DEFINITIONS
|
99
100
|
comm_spec = COMMAND_DEFINITIONS.get('Command Specifications', {})
|
100
101
|
for key, value in comm_spec.items():
|
101
102
|
if isinstance(value, dict):
|
102
|
-
v = value.get('alternate_names',"")
|
103
|
+
v = value.get('alternate_names', "")
|
103
104
|
if command in v:
|
104
105
|
return key
|
105
106
|
return None
|
106
107
|
|
108
|
+
|
107
109
|
def get_alternate_names(command: str) -> list | None:
|
108
110
|
global COMMAND_DEFINITIONS
|
109
111
|
return get_command_spec(command).get('alternate_names', None)
|
pyegeria/_client.py
CHANGED
@@ -786,6 +786,45 @@ class Client:
|
|
786
786
|
return q_name
|
787
787
|
|
788
788
|
|
789
|
+
async def _async_get_element_by_guid_(self, element_guid: str) -> dict | str:
|
790
|
+
"""
|
791
|
+
Simplified, internal version of get_element_by_guid found in Classification Manager.
|
792
|
+
Retrieve an element by its guid. Async version.
|
793
|
+
|
794
|
+
Parameters
|
795
|
+
----------
|
796
|
+
element_guid: str
|
797
|
+
- unique identifier for the element
|
798
|
+
|
799
|
+
Returns
|
800
|
+
-------
|
801
|
+
dict | str
|
802
|
+
Returns a string if no element found; otherwise a dict of the element.
|
803
|
+
|
804
|
+
Raises
|
805
|
+
------
|
806
|
+
InvalidParameterException
|
807
|
+
one of the parameters is null or invalid or
|
808
|
+
PropertyServerException
|
809
|
+
There is a problem adding the element properties to the metadata repository or
|
810
|
+
UserNotAuthorizedException
|
811
|
+
the requesting user is not authorized to issue this request.
|
812
|
+
"""
|
813
|
+
|
814
|
+
body = {
|
815
|
+
"class": "EffectiveTimeQueryRequestBody",
|
816
|
+
"effectiveTime": None,
|
817
|
+
}
|
818
|
+
|
819
|
+
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/classification-manager/elements/"
|
820
|
+
f"{element_guid}?forLineage=false&forDuplicateProcessing=false")
|
821
|
+
|
822
|
+
response: Response = await self._async_make_request("POST", url, body_slimmer(body))
|
823
|
+
|
824
|
+
elements = response.json().get("element", NO_ELEMENTS_FOUND)
|
825
|
+
|
826
|
+
return elements
|
827
|
+
|
789
828
|
|
790
829
|
if __name__ == "__main__":
|
791
830
|
print("Main-__client")
|
@@ -961,7 +961,7 @@ class ClassificationManager(Client):
|
|
961
961
|
the requesting user is not authorized to issue this request.
|
962
962
|
"""
|
963
963
|
|
964
|
-
property_name = ["name", "displayName", "title"]
|
964
|
+
property_name = ["name", "displayName", "title","qualifiedName"]
|
965
965
|
elements = await self._async_get_elements_by_property_value(
|
966
966
|
name, property_name, None
|
967
967
|
)
|