pyegeria 5.4.0.dev5__py3-none-any.whl → 5.4.0.dev7__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/dr_egeria_command_help.py +273 -0
- commands/cat/list_data_designer.py +1 -1
- md_processing/data/commands.json +1629 -308
- md_processing/md_commands/data_designer_commands.py +5 -125
- md_processing/md_processing_utils/generate_dr_help.py +150 -0
- md_processing/md_processing_utils/generate_md_templates.py +92 -0
- pyegeria/data_designer_omvs.py +17 -17
- pyegeria/glossary_browser_omvs.py +5 -6
- pyegeria/output_formatter.py +12 -7
- pyegeria/solution_architect_omvs.py +4 -4
- {pyegeria-5.4.0.dev5.dist-info → pyegeria-5.4.0.dev7.dist-info}/METADATA +1 -1
- {pyegeria-5.4.0.dev5.dist-info → pyegeria-5.4.0.dev7.dist-info}/RECORD +15 -16
- {pyegeria-5.4.0.dev5.dist-info → pyegeria-5.4.0.dev7.dist-info}/entry_points.txt +1 -0
- commands/cat/debug_log +0 -227
- md_processing/dr_egeria_outbox/processed-2025-06-22 21:06-dr_egeria_data_designer_1.md +0 -134
- md_processing/dr_egeria_outbox/processed-2025-06-22 21:13-dr_egeria_data_designer_1.md +0 -133
- md_processing/dr_egeria_outbox/processed-2025-06-22 21:19-dr_egeria_data_designer_1.md +0 -141
- {pyegeria-5.4.0.dev5.dist-info → pyegeria-5.4.0.dev7.dist-info}/LICENSE +0 -0
- {pyegeria-5.4.0.dev5.dist-info → pyegeria-5.4.0.dev7.dist-info}/WHEEL +0 -0
@@ -16,6 +16,7 @@ from md_processing.md_processing_utils.extraction_utils import (extract_command_
|
|
16
16
|
from md_processing.md_processing_utils.md_processing_constants import (load_commands, ERROR)
|
17
17
|
from pyegeria import DEBUG_LEVEL, body_slimmer
|
18
18
|
from pyegeria.egeria_tech_client import EgeriaTech
|
19
|
+
from pyegeria.output_formatter import (extract_mermaid_only, extract_basic_dict, generate_output)
|
19
20
|
|
20
21
|
|
21
22
|
GERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
|
@@ -1422,7 +1423,7 @@ def process_data_collection_list_command(egeria_client: EgeriaTech, txt: str, di
|
|
1422
1423
|
attributes = parsed_output['attributes']
|
1423
1424
|
|
1424
1425
|
valid = parsed_output['valid']
|
1425
|
-
|
1426
|
+
print(Markdown(f"Performing {command}"))
|
1426
1427
|
print(Markdown(parsed_output['display']))
|
1427
1428
|
|
1428
1429
|
if directive == "display":
|
@@ -1485,7 +1486,7 @@ def process_data_structure_list_command(egeria_client: EgeriaTech, txt: str, dir
|
|
1485
1486
|
attributes = parsed_output['attributes']
|
1486
1487
|
|
1487
1488
|
valid = parsed_output['valid']
|
1488
|
-
|
1489
|
+
print(Markdown(f"Performing {command}"))
|
1489
1490
|
print(Markdown(parsed_output['display']))
|
1490
1491
|
|
1491
1492
|
if directive == "display":
|
@@ -1545,7 +1546,7 @@ def process_data_field_list_command(egeria_client: EgeriaTech, txt: str, directi
|
|
1545
1546
|
attributes = parsed_output['attributes']
|
1546
1547
|
|
1547
1548
|
valid = parsed_output['valid']
|
1548
|
-
|
1549
|
+
print(Markdown(f"Performing {command}"))
|
1549
1550
|
print(Markdown(parsed_output['display']))
|
1550
1551
|
|
1551
1552
|
if directive == "display":
|
@@ -1605,7 +1606,7 @@ def process_data_class_list_command(egeria_client: EgeriaTech, txt: str, directi
|
|
1605
1606
|
attributes = parsed_output['attributes']
|
1606
1607
|
|
1607
1608
|
valid = parsed_output['valid']
|
1608
|
-
|
1609
|
+
print(Markdown(f"Performing {command}"))
|
1609
1610
|
print(Markdown(parsed_output['display']))
|
1610
1611
|
|
1611
1612
|
if directive == "display":
|
@@ -1648,125 +1649,4 @@ def process_data_class_list_command(egeria_client: EgeriaTech, txt: str, directi
|
|
1648
1649
|
else:
|
1649
1650
|
return None
|
1650
1651
|
|
1651
|
-
# @logger.catch
|
1652
|
-
# def process_list_data_dictionary_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") ->
|
1653
|
-
# Optional[str]:
|
1654
|
-
# """
|
1655
|
-
# Processes a list data dictionary.
|
1656
|
-
#
|
1657
|
-
# :param txt: A string representing the input cell to be processed for
|
1658
|
-
# extracting term-related attributes.
|
1659
|
-
# :param directive: an optional string indicating the directive to be used - display, validate or execute
|
1660
|
-
# :return: A string summarizing the outcome of the processing.
|
1661
|
-
# """
|
1662
|
-
#
|
1663
|
-
#
|
1664
|
-
# if directive == "display":
|
1665
|
-
# print(Markdown(f"\n* Command: {object_action}\n\t* Term Name: {term_name}\n\t* Output Format: {
|
1666
|
-
# output_format}"))
|
1667
|
-
# return None
|
1668
|
-
# elif directive == "validate":
|
1669
|
-
# print(Markdown(f"\n* Command: {object_action}\n\t* Term Name: {term_name}\n\t* Output Format: {
|
1670
|
-
# output_format}"))
|
1671
|
-
# return True
|
1672
|
-
# elif directive == "process":
|
1673
|
-
# print(Markdown(f"\n* Command: {object_action}\n\t* Term Name: {term_name}\n\t* Output Format: {
|
1674
|
-
# output_format}"))
|
1675
|
-
# return egeria_client.get_term_by_guid(known_guid, output_format=output_format)
|
1676
1652
|
|
1677
|
-
#
|
1678
|
-
# def process_term_history_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[str]:
|
1679
|
-
# """
|
1680
|
-
# Processes a term history object_action by extracting key attributes such as
|
1681
|
-
# term name and output format from the given text.
|
1682
|
-
#
|
1683
|
-
# :param txt: A string representing the input cell to be processed for
|
1684
|
-
# extracting term-related attributes.
|
1685
|
-
# :param directive: an optional string indicating the directive to be used - display, validate or execute
|
1686
|
-
# :return: A string summarizing the outcome of the processing.
|
1687
|
-
# """
|
1688
|
-
# from md_processing.md_processing_utils.common_md_utils import set_debug_level
|
1689
|
-
#
|
1690
|
-
# object_action = extract_command(txt)
|
1691
|
-
# set_debug_level(directive)
|
1692
|
-
# print(Markdown(f"{pre_command} `{object_action}` with directive: `{directive}`"))
|
1693
|
-
#
|
1694
|
-
# term_name = process_simple_attribute(txt, TERM_NAME_LABELS, ERROR)
|
1695
|
-
# output_format = process_simple_attribute(txt, OUTPUT_LABELS)
|
1696
|
-
# output_format = output_format.upper() if output_format else "MD"
|
1697
|
-
# if output_format not in ELEMENT_OUTPUT_FORMATS:
|
1698
|
-
# print_msg(WARNING, f"Output format {output_format} not recognized, using MD", debug_level)
|
1699
|
-
# output_format = "MD"
|
1700
|
-
#
|
1701
|
-
# if term_name is None:
|
1702
|
-
# print_msg(ERROR, "No term name found", debug_level)
|
1703
|
-
# return None
|
1704
|
-
#
|
1705
|
-
# known_q_name, known_guid, valid, term_exists = process_element_identifiers(egeria_client, "Term",
|
1706
|
-
# TERM_NAME_LABELS, txt,
|
1707
|
-
# EXISTS_REQUIRED, None)
|
1708
|
-
# if not term_exists:
|
1709
|
-
# print_msg(ERROR, f"Term {term_name} not found", debug_level)
|
1710
|
-
# return None
|
1711
|
-
#
|
1712
|
-
# if directive == "display":
|
1713
|
-
# print(Markdown(f"\n* Command: {object_action}\n\t* Term Name: {term_name}\n\t* Output Format: {
|
1714
|
-
# output_format}"))
|
1715
|
-
# return None
|
1716
|
-
# elif directive == "validate":
|
1717
|
-
# print(Markdown(f"\n* Command: {object_action}\n\t* Term Name: {term_name}\n\t* Output Format: {
|
1718
|
-
# output_format}"))
|
1719
|
-
# return True
|
1720
|
-
# elif directive == "process":
|
1721
|
-
# print(Markdown(f"\n* Command: {object_action}\n\t* Term Name: {term_name}\n\t* Output Format: {
|
1722
|
-
# output_format}"))
|
1723
|
-
# return egeria_client.get_term_history(known_guid, output_format=output_format)
|
1724
|
-
#
|
1725
|
-
#
|
1726
|
-
# def process_term_revision_history_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") ->
|
1727
|
-
# Optional[str]:
|
1728
|
-
# """
|
1729
|
-
# Processes a term revision history object_action by extracting key attributes such as
|
1730
|
-
# term name and output format from the given text.
|
1731
|
-
#
|
1732
|
-
# :param txt: A string representing the input cell to be processed for
|
1733
|
-
# extracting term-related attributes.
|
1734
|
-
# :param directive: an optional string indicating the directive to be used - display, validate or execute
|
1735
|
-
# :return: A string summarizing the outcome of the processing.
|
1736
|
-
# """
|
1737
|
-
# from md_processing.md_processing_utils.common_md_utils import set_debug_level
|
1738
|
-
#
|
1739
|
-
# object_action = extract_command(txt)
|
1740
|
-
# set_debug_level(directive)
|
1741
|
-
# print(Markdown(f"{pre_command} `{object_action}` with directive: `{directive}`"))
|
1742
|
-
#
|
1743
|
-
# term_name = process_simple_attribute(txt, TERM_NAME_LABELS, ERROR)
|
1744
|
-
# output_format = process_simple_attribute(txt, OUTPUT_LABELS)
|
1745
|
-
# output_format = output_format.upper() if output_format else "MD"
|
1746
|
-
# if output_format not in ELEMENT_OUTPUT_FORMATS:
|
1747
|
-
# print_msg(WARNING, f"Output format {output_format} not recognized, using MD", debug_level)
|
1748
|
-
# output_format = "MD"
|
1749
|
-
#
|
1750
|
-
# if term_name is None:
|
1751
|
-
# print_msg(ERROR, "No term name found", debug_level)
|
1752
|
-
# return None
|
1753
|
-
#
|
1754
|
-
# known_q_name, known_guid, valid, term_exists = process_element_identifiers(egeria_client, "Term",
|
1755
|
-
# TERM_NAME_LABELS, txt,
|
1756
|
-
# EXISTS_REQUIRED, None)
|
1757
|
-
# if not term_exists:
|
1758
|
-
# print_msg(ERROR, f"Term {term_name} not found", debug_level)
|
1759
|
-
# return None
|
1760
|
-
#
|
1761
|
-
# if directive == "display":
|
1762
|
-
# print(Markdown(f"\n* Command: {object_action}\n\t* Term Name: {term_name}\n\t* Output Format: {
|
1763
|
-
# output_format}"))
|
1764
|
-
# return None
|
1765
|
-
# elif directive == "validate":
|
1766
|
-
# print(Markdown(f"\n* Command: {object_action}\n\t* Term Name: {term_name}\n\t* Output Format: {
|
1767
|
-
# output_format}"))
|
1768
|
-
# return True
|
1769
|
-
# elif directive == "process":
|
1770
|
-
# print(Markdown(f"\n* Command: {object_action}\n\t* Term Name: {term_name}\n\t* Output Format: {
|
1771
|
-
# output_format}"))
|
1772
|
-
# return egeria_client.get_term_revision_history(known_guid, output_format=output_format)
|
@@ -0,0 +1,150 @@
|
|
1
|
+
"""
|
2
|
+
This file contains general utility functions for processing Egeria Markdown
|
3
|
+
"""
|
4
|
+
import json
|
5
|
+
import os
|
6
|
+
import sys
|
7
|
+
from typing import List
|
8
|
+
|
9
|
+
from loguru import logger
|
10
|
+
from rich import print
|
11
|
+
from rich.console import Console
|
12
|
+
from rich.markdown import Markdown
|
13
|
+
|
14
|
+
from commands.cat.dr_egeria_command_help import EGERIA_INBOX_PATH
|
15
|
+
from md_processing.md_processing_utils.common_md_utils import (get_current_datetime_string, get_element_dictionary,
|
16
|
+
update_element_dictionary,
|
17
|
+
split_tb_string, str_to_bool, )
|
18
|
+
from md_processing.md_processing_utils.extraction_utils import (process_simple_attribute, extract_attribute,
|
19
|
+
get_element_by_name)
|
20
|
+
from md_processing.md_processing_utils.md_processing_constants import (get_command_spec, load_commands, load_commands, COMMAND_DEFINITIONS)
|
21
|
+
|
22
|
+
from md_processing.md_processing_utils.message_constants import (ERROR, INFO, WARNING, ALWAYS, EXISTS_REQUIRED)
|
23
|
+
from pyegeria import EgeriaTech
|
24
|
+
from pyegeria._globals import DEBUG_LEVEL
|
25
|
+
from pyegeria.output_formatter import generate_entity_md_table
|
26
|
+
|
27
|
+
# Constants
|
28
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
29
|
+
EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", ".")
|
30
|
+
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", ".")
|
31
|
+
|
32
|
+
console = Console(width=EGERIA_WIDTH)
|
33
|
+
|
34
|
+
debug_level = DEBUG_LEVEL
|
35
|
+
global COMMAND_DEFINITIONS
|
36
|
+
|
37
|
+
load_commands('commands.json')
|
38
|
+
|
39
|
+
|
40
|
+
log_format = "D {time} | {level} | {function} | {line} | {message} | {extra}"
|
41
|
+
logger.remove()
|
42
|
+
logger.add(sys.stderr, level="INFO", format=log_format, colorize=True)
|
43
|
+
full_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_INBOX_PATH, "data_designer_debug.log")
|
44
|
+
# logger.add(full_file_path, rotation="1 day", retention="1 week", compression="zip", level="TRACE", format=log_format,
|
45
|
+
# colorize=True)
|
46
|
+
logger.add("debug_log", rotation="1 day", retention="1 week", compression="zip", level="TRACE", format=log_format,
|
47
|
+
colorize=True)
|
48
|
+
def yes_no(input: str)->str:
|
49
|
+
if type(input) is bool:
|
50
|
+
if input:
|
51
|
+
return "True"
|
52
|
+
else:
|
53
|
+
return "False"
|
54
|
+
|
55
|
+
input = input.title()
|
56
|
+
if input in ["Yes","No"]:
|
57
|
+
return input
|
58
|
+
|
59
|
+
if input in ["True", "T"]:
|
60
|
+
return "Yes"
|
61
|
+
else:
|
62
|
+
return "No"
|
63
|
+
|
64
|
+
@logger.catch
|
65
|
+
def _extract_help_fields(command: dict):
|
66
|
+
"""
|
67
|
+
|
68
|
+
"""
|
69
|
+
|
70
|
+
command_spec = get_command_spec(command)
|
71
|
+
attributes = command_spec.get('Attributes', [])
|
72
|
+
command_display_name = command_spec.get('display_name', None)
|
73
|
+
command_qn_prefix = command_spec.get('qn_prefix', None)
|
74
|
+
|
75
|
+
term_entry: list = []
|
76
|
+
for attr in attributes:
|
77
|
+
for key in attr:
|
78
|
+
if attr[key].get('level','Basic') != "Basic":
|
79
|
+
continue
|
80
|
+
attribute_name = key
|
81
|
+
input_required = yes_no(attr[key].get('input_required', "No"))
|
82
|
+
|
83
|
+
read_only = yes_no(attr[key].get('user_specified', "No"))
|
84
|
+
generated = yes_no(attr[key].get('generated', "No"))
|
85
|
+
default = attr[key].get('default', None)
|
86
|
+
if default:
|
87
|
+
generated = default
|
88
|
+
unique = yes_no(attr[key].get('unique', "No"))
|
89
|
+
notes = attr[key].get('description', "")
|
90
|
+
valid_values = attr[key].get('valid_values', [])
|
91
|
+
term_entry.append ({
|
92
|
+
'Attribute Name' : attribute_name,
|
93
|
+
'Input Required' : input_required,
|
94
|
+
'Read Only' : read_only,
|
95
|
+
'Generated' : generated,
|
96
|
+
'Default Value' : default,
|
97
|
+
'Notes' : notes,
|
98
|
+
'Unique Values' : unique,
|
99
|
+
'Valid Values' : valid_values,
|
100
|
+
})
|
101
|
+
|
102
|
+
return term_entry
|
103
|
+
|
104
|
+
def create_help_terms():
|
105
|
+
term_entry:str = ""
|
106
|
+
glossary_name = "Egeria-Markdown"
|
107
|
+
commands = COMMAND_DEFINITIONS["Command Specifications"]
|
108
|
+
columns = [{'name': "Attribute Name", 'key': 'Attribute Name'},
|
109
|
+
{'name': 'Input Required', 'key': 'Input Required'},
|
110
|
+
{'name': 'Read Only', 'key': 'Read Only'},
|
111
|
+
{'name': 'Generated', 'key': 'Generated'},
|
112
|
+
{'name': 'Default Value', 'key': 'Default Value'},
|
113
|
+
{'name': 'Notes', 'key': 'Notes'},
|
114
|
+
{'name': 'Unique Values', 'key': 'Unique Values'},
|
115
|
+
{'name': 'Valid Values', 'key': 'Valid Values'}]
|
116
|
+
|
117
|
+
term_entry = """# Generating glossary entries for the documented commands\n\n
|
118
|
+
This file contains generated Dr.Egeria commands to generate glossary term entries describing
|
119
|
+
each command represented in the `commands.json` file.\n"""
|
120
|
+
|
121
|
+
for command, values in commands.items():
|
122
|
+
if command == "exported":
|
123
|
+
continue
|
124
|
+
if commands[command].get("level","") not in ["Basic"]:
|
125
|
+
continue
|
126
|
+
command_description = commands[command].get("description","")
|
127
|
+
command_verb = commands[command].get("verb","")
|
128
|
+
|
129
|
+
term_entry+= "# Create Term\n"
|
130
|
+
term_entry+= f"## Term Name\n\n{command_verb} {command}\n\n"
|
131
|
+
term_entry+= f"## Description\n\n{command_description}\n\n"
|
132
|
+
term_entry+= f"## Owning Glossary\n\n{glossary_name}\n\n"
|
133
|
+
term_entry+= f"## Categories\n\nWriting Dr.Egeria Markdown\n\n"
|
134
|
+
|
135
|
+
|
136
|
+
du = _extract_help_fields(command)
|
137
|
+
output = generate_entity_md_table(du, "", "", _extract_help_fields, columns, None, "help" )
|
138
|
+
|
139
|
+
term_entry+= f"## Usage\n\n{output}\n\n___\n\n"
|
140
|
+
print(term_entry)
|
141
|
+
file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_INBOX_PATH, "generated_help_terms.md")
|
142
|
+
with open(file_path, 'a', encoding="utf-8") as f:
|
143
|
+
f.write(term_entry)
|
144
|
+
|
145
|
+
def main():
|
146
|
+
create_help_terms()
|
147
|
+
|
148
|
+
|
149
|
+
if __name__ == "__main__":
|
150
|
+
main()
|
@@ -0,0 +1,92 @@
|
|
1
|
+
"""
|
2
|
+
This file contains general utility functions for processing Egeria Markdown
|
3
|
+
"""
|
4
|
+
import os
|
5
|
+
import sys
|
6
|
+
from typing import List
|
7
|
+
|
8
|
+
from loguru import logger
|
9
|
+
from rich import print
|
10
|
+
from rich.console import Console
|
11
|
+
|
12
|
+
from commands.cat.dr_egeria_command_help import EGERIA_INBOX_PATH
|
13
|
+
from md_processing.md_processing_utils.common_md_utils import (get_current_datetime_string, get_element_dictionary,
|
14
|
+
update_element_dictionary,
|
15
|
+
split_tb_string, str_to_bool, )
|
16
|
+
from md_processing.md_processing_utils.extraction_utils import (process_simple_attribute, extract_attribute,
|
17
|
+
get_element_by_name)
|
18
|
+
from md_processing.md_processing_utils.md_processing_constants import (get_command_spec, load_commands, load_commands, COMMAND_DEFINITIONS)
|
19
|
+
|
20
|
+
from md_processing.md_processing_utils.message_constants import (ERROR, INFO, WARNING, ALWAYS, EXISTS_REQUIRED)
|
21
|
+
from pyegeria import EgeriaTech
|
22
|
+
from pyegeria._globals import DEBUG_LEVEL
|
23
|
+
|
24
|
+
|
25
|
+
# Constants
|
26
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
27
|
+
EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", ".")
|
28
|
+
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", ".")
|
29
|
+
|
30
|
+
console = Console(width=EGERIA_WIDTH)
|
31
|
+
|
32
|
+
debug_level = DEBUG_LEVEL
|
33
|
+
global COMMAND_DEFINITIONS
|
34
|
+
|
35
|
+
load_commands('commands.json')
|
36
|
+
|
37
|
+
|
38
|
+
log_format = "D {time} | {level} | {function} | {line} | {message} | {extra}"
|
39
|
+
logger.remove()
|
40
|
+
logger.add(sys.stderr, level="INFO", format=log_format, colorize=True)
|
41
|
+
full_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_INBOX_PATH, "data_designer_debug.log")
|
42
|
+
# logger.add(full_file_path, rotation="1 day", retention="1 week", compression="zip", level="TRACE", format=log_format,
|
43
|
+
# colorize=True)
|
44
|
+
logger.add("debug_log", rotation="1 day", retention="1 week", compression="zip", level="TRACE", format=log_format,
|
45
|
+
colorize=True)
|
46
|
+
@logger.catch
|
47
|
+
def main():
|
48
|
+
"""
|
49
|
+
|
50
|
+
"""
|
51
|
+
glossary_name = "Egeria-Markdown"
|
52
|
+
commands = COMMAND_DEFINITIONS["Command Specifications"]
|
53
|
+
for command, values in commands.items():
|
54
|
+
if command == "exported":
|
55
|
+
continue
|
56
|
+
if commands[command].get("level","") not in ["Basic"]:
|
57
|
+
continue
|
58
|
+
command_description = commands[command].get("description","")
|
59
|
+
command_verb = commands[command].get("verb","")
|
60
|
+
print(f"\n# {command_verb} {command}\n>\t{command_description}")
|
61
|
+
|
62
|
+
attributes = commands[command]['Attributes']
|
63
|
+
for attribute in attributes:
|
64
|
+
for key, value in attribute.items():
|
65
|
+
if value.get('level',"") not in ["Basic"]:
|
66
|
+
continue
|
67
|
+
user_specified = value.get('user_specified', 'true') in ["true", "True"]
|
68
|
+
|
69
|
+
print(f"\n## {key}")
|
70
|
+
|
71
|
+
print(f">\tInput Required: {value.get('input_required', "false")}")
|
72
|
+
|
73
|
+
print(f">\tDescription: {value.get("description","")}")
|
74
|
+
labels = value.get("attr_labels", None)
|
75
|
+
if labels:
|
76
|
+
print(f">\tAlternative Labels: {labels}")
|
77
|
+
|
78
|
+
valid_values = value.get("valid_values", None)
|
79
|
+
if valid_values:
|
80
|
+
print(f">\tValid Values: {valid_values}")
|
81
|
+
default_value = value.get("default_value", None)
|
82
|
+
if default_value:
|
83
|
+
print(f">\tDefault Value: {default_value}")
|
84
|
+
print("\n___\n")
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
#
|
90
|
+
|
91
|
+
if __name__ == "__main__":
|
92
|
+
main()
|
pyegeria/data_designer_omvs.py
CHANGED
@@ -678,23 +678,23 @@ r replace_all_properties: bool, default = False
|
|
678
678
|
|
679
679
|
|
680
680
|
# extract existing related data structure and data field elements
|
681
|
-
other_related_elements = el_struct
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
681
|
+
other_related_elements = el_struct.get("otherRelatedElements",None)
|
682
|
+
if other_related_elements:
|
683
|
+
for rel in other_related_elements:
|
684
|
+
related_element = rel["relatedElement"]
|
685
|
+
type = related_element["elementHeader"]["type"]["typeName"]
|
686
|
+
guid = related_element["elementHeader"]["guid"]
|
687
|
+
qualified_name = related_element["properties"].get("qualifiedName","") or ""
|
688
|
+
display_name = related_element["properties"].get("displayName","") or ""
|
689
|
+
if type == "DataStructure":
|
690
|
+
data_structure_guids.append(guid)
|
691
|
+
data_structure_names.append(display_name)
|
692
|
+
data_structure_qnames.append(qualified_name)
|
693
|
+
|
694
|
+
elif type == "DataField":
|
695
|
+
parent_guids.append(guid)
|
696
|
+
parent_names.append(display_name)
|
697
|
+
parent_qnames.append(qualified_name)
|
698
698
|
|
699
699
|
|
700
700
|
member_of_collections = el_struct.get("memberOfCollections",{})
|
@@ -90,7 +90,7 @@ class GlossaryBrowser(Client):
|
|
90
90
|
category_qualified_names = cat_md_qn.rstrip(',')
|
91
91
|
|
92
92
|
result = {
|
93
|
-
'
|
93
|
+
'GUID': guid, 'properties': properties, 'display_name': display_name, 'description': description,
|
94
94
|
'language': language, 'usage': usage, 'qualified_name': qualified_name
|
95
95
|
}
|
96
96
|
|
@@ -312,7 +312,7 @@ class GlossaryBrowser(Client):
|
|
312
312
|
aliases = ", ".join(properties.get("aliases", "")) or ""
|
313
313
|
|
314
314
|
return {
|
315
|
-
'
|
315
|
+
'GUID': guid, 'properties': properties, 'display_name': display_name, 'aliases': aliases,
|
316
316
|
'summary': summary, 'description': description, 'examples': examples, 'usage': usage,
|
317
317
|
'version identifier': pub_version, 'qualified_name': qualified_name, 'status': status
|
318
318
|
}
|
@@ -626,7 +626,7 @@ class GlossaryBrowser(Client):
|
|
626
626
|
qualified_name = properties.get("qualifiedName", "") or ""
|
627
627
|
|
628
628
|
return {
|
629
|
-
'
|
629
|
+
'GUID': guid, 'properties': properties, 'display_name': display_name, 'description': description,
|
630
630
|
'qualified_name': qualified_name
|
631
631
|
}
|
632
632
|
|
@@ -1051,7 +1051,6 @@ class GlossaryBrowser(Client):
|
|
1051
1051
|
"class": "SearchStringRequestBody", "searchString": search_string, "effectiveTime": effective_time,
|
1052
1052
|
"typeName": type_name,
|
1053
1053
|
}
|
1054
|
-
body = body_slimmer(body)
|
1055
1054
|
|
1056
1055
|
url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-browser/glossaries/"
|
1057
1056
|
f"by-search-string?startFrom={start_from}&pageSize={page_size}&startsWith={starts_with_s}&"
|
@@ -2176,11 +2175,11 @@ class GlossaryBrowser(Client):
|
|
2176
2175
|
parent_guid = parent['elementHeader']['guid']
|
2177
2176
|
parent_name = parent['glossaryCategoryProperties'].get('displayName', '---')
|
2178
2177
|
parent_info = {
|
2179
|
-
'
|
2178
|
+
'GUID': parent_guid, 'name': parent_name
|
2180
2179
|
}
|
2181
2180
|
|
2182
2181
|
return {
|
2183
|
-
'
|
2182
|
+
'GUID': category_guid, 'name': display_name, 'qualifiedName': qualified_name,
|
2184
2183
|
'description': description, 'parent': parent_info, 'children': children
|
2185
2184
|
}
|
2186
2185
|
|
pyegeria/output_formatter.py
CHANGED
@@ -128,7 +128,7 @@ def generate_entity_md(elements: List[Dict],
|
|
128
128
|
# Get additional properties if function is provided
|
129
129
|
additional_props = {}
|
130
130
|
if get_additional_props_func:
|
131
|
-
additional_props = get_additional_props_func(element,
|
131
|
+
additional_props = get_additional_props_func(element,props['GUID'], output_format)
|
132
132
|
|
133
133
|
|
134
134
|
# Format header based on output format
|
@@ -150,7 +150,7 @@ def generate_entity_md(elements: List[Dict],
|
|
150
150
|
elements_md += make_md_attribute(key.replace('_', ' '), value, output_format)
|
151
151
|
|
152
152
|
# # Add GUID
|
153
|
-
# elements_md += make_md_attribute("GUID",
|
153
|
+
# elements_md += make_md_attribute("GUID",props['GUID'], output_format)
|
154
154
|
|
155
155
|
# Add separator if not the last element
|
156
156
|
if element != elements[-1]:
|
@@ -183,8 +183,10 @@ def generate_entity_md_table(elements: List[Dict],
|
|
183
183
|
# Handle pluralization - if entity_type ends with 'y', use 'ies' instead of 's'
|
184
184
|
entity_type_plural = f"{entity_type[:-1]}ies" if entity_type.endswith('y') else f"{entity_type}s"
|
185
185
|
|
186
|
-
elements_md =
|
187
|
-
|
186
|
+
elements_md = ""
|
187
|
+
if output_format == "LIST":
|
188
|
+
elements_md = f"# {entity_type_plural} Table\n\n"
|
189
|
+
elements_md += f"{entity_type_plural} found from the search string: `{search_string}`\n\n"
|
188
190
|
|
189
191
|
# Add column headers
|
190
192
|
header_row = "| "
|
@@ -198,12 +200,15 @@ def generate_entity_md_table(elements: List[Dict],
|
|
198
200
|
|
199
201
|
# Add rows
|
200
202
|
for element in elements:
|
201
|
-
|
203
|
+
if output_format == "help":
|
204
|
+
props = element
|
205
|
+
else:
|
206
|
+
props = extract_properties_func(element)
|
202
207
|
|
203
208
|
# Get additional properties if function is provided
|
204
209
|
additional_props = {}
|
205
210
|
if get_additional_props_func:
|
206
|
-
additional_props = get_additional_props_func(element,
|
211
|
+
additional_props = get_additional_props_func(element,props['GUID'], output_format)
|
207
212
|
|
208
213
|
# Build row
|
209
214
|
row = "| "
|
@@ -257,7 +262,7 @@ def generate_entity_dict(elements: List[Dict],
|
|
257
262
|
# Get additional properties if function is provided
|
258
263
|
additional_props = {}
|
259
264
|
if get_additional_props_func:
|
260
|
-
additional_props = get_additional_props_func(element,
|
265
|
+
additional_props = get_additional_props_func(element,props['GUID'], output_format)
|
261
266
|
|
262
267
|
# Create entity dictionary
|
263
268
|
entity_dict = {}
|
@@ -153,7 +153,7 @@ class SolutionArchitect(Client):
|
|
153
153
|
segments_list.append(segment_dict)
|
154
154
|
|
155
155
|
return {
|
156
|
-
'
|
156
|
+
'GUID': guid,
|
157
157
|
'qualified_name': qualified_name,
|
158
158
|
'display_name': display_name,
|
159
159
|
'description': description,
|
@@ -193,7 +193,7 @@ class SolutionArchitect(Client):
|
|
193
193
|
mer = f"```mermaid\n\n{element.get('mermaidGraph', None)}\n\n```"
|
194
194
|
|
195
195
|
return {
|
196
|
-
'
|
196
|
+
'GUID': guid,
|
197
197
|
'qualified_name': qualified_name,
|
198
198
|
'display_name': display_name,
|
199
199
|
'description': description,
|
@@ -232,7 +232,7 @@ class SolutionArchitect(Client):
|
|
232
232
|
solution_components_md += "{" + f" {sol_comp_name}:\t {sol_comp_desc}" + " },\n"
|
233
233
|
|
234
234
|
return {
|
235
|
-
'
|
235
|
+
'GUID': guid,
|
236
236
|
'qualified_name': qualified_name,
|
237
237
|
'display_name': display_name,
|
238
238
|
'description': description,
|
@@ -334,7 +334,7 @@ class SolutionArchitect(Client):
|
|
334
334
|
comp_graph = element.get('mermaidGraph', None)
|
335
335
|
|
336
336
|
return {
|
337
|
-
'
|
337
|
+
'GUID': guid,
|
338
338
|
'qualified_name': qualified_name,
|
339
339
|
'display_name': display_name,
|
340
340
|
'description': description,
|