pyegeria 5.3.10__py3-none-any.whl → 5.4.0__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 +2806 -0
- commands/cat/debug_log.2025-07-15_14-28-38_087378.zip +0 -0
- commands/cat/debug_log.2025-07-16_15-48-50_037087.zip +0 -0
- commands/cat/dr_egeria_command_help.py +273 -0
- commands/cat/dr_egeria_md.py +90 -20
- commands/cat/glossary_actions.py +2 -2
- commands/cat/list_collections.py +24 -10
- commands/cat/list_data_designer.py +183 -0
- md_processing/__init__.py +28 -5
- md_processing/data/commands.json +31474 -1096
- md_processing/dr_egeria_outbox-pycharm/.obsidian/app.json +1 -0
- md_processing/dr_egeria_outbox-pycharm/.obsidian/appearance.json +1 -0
- md_processing/dr_egeria_outbox-pycharm/.obsidian/core-plugins.json +31 -0
- md_processing/dr_egeria_outbox-pycharm/.obsidian/workspace.json +177 -0
- md_processing/dr_egeria_outbox-pycharm/monday/processed-2025-07-14 12:38-data_designer_out.md +663 -0
- md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 15:00-Derive-Dr-Gov-Defs.md +719 -0
- md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:13-Derive-Dr-Gov-Defs.md +41 -0
- md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:14-Derive-Dr-Gov-Defs.md +33 -0
- md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:50-Derive-Dr-Gov-Defs.md +192 -0
- md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-16 19:15-gov_def2.md +527 -0
- md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-17 12:08-gov_def2.md +527 -0
- md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-17 14:27-gov_def2.md +474 -0
- md_processing/family_docs/Data Designer/Create_Data_Class.md +164 -0
- md_processing/family_docs/Data Designer/Create_Data_Dictionary.md +30 -0
- md_processing/family_docs/Data Designer/Create_Data_Field.md +162 -0
- md_processing/family_docs/Data Designer/Create_Data_Specification.md +36 -0
- md_processing/family_docs/Data Designer/Create_Data_Structure.md +38 -0
- md_processing/family_docs/Data Designer/View_Data_Classes.md +78 -0
- md_processing/family_docs/Data Designer/View_Data_Dictionaries.md +78 -0
- md_processing/family_docs/Data Designer/View_Data_Fields.md +78 -0
- md_processing/family_docs/Data Designer/View_Data_Specifications.md +78 -0
- md_processing/family_docs/Data Designer/View_Data_Structures.md +78 -0
- md_processing/family_docs/Data Designer.md +842 -0
- md_processing/family_docs/Digital Product Manager/Add_Member->Collection.md +42 -0
- md_processing/family_docs/Digital Product Manager/Attach_Collection->Resource.md +36 -0
- md_processing/family_docs/Digital Product Manager/Create_Agreement.md +96 -0
- md_processing/family_docs/Digital Product Manager/Create_Data_Sharing_Agreement.md +72 -0
- md_processing/family_docs/Digital Product Manager/Create_DigitalSubscription.md +102 -0
- md_processing/family_docs/Digital Product Manager/Create_Digital_Product.md +134 -0
- md_processing/family_docs/Digital Product Manager/Link_Agreement_Items.md +60 -0
- md_processing/family_docs/Digital Product Manager/Link_Contracts.md +26 -0
- md_processing/family_docs/Digital Product Manager/Link_Digital_Product_-_Digital_Product.md +30 -0
- md_processing/family_docs/Digital Product Manager/Link_Subscribers.md +48 -0
- md_processing/family_docs/Digital Product Manager.md +668 -0
- md_processing/family_docs/Glossary/Attach_Category_Parent.md +18 -0
- md_processing/family_docs/Glossary/Attach_Term-Term_Relationship.md +26 -0
- md_processing/family_docs/Glossary/Create_Category.md +38 -0
- md_processing/family_docs/Glossary/Create_Glossary.md +42 -0
- md_processing/family_docs/Glossary/Create_Term.md +70 -0
- md_processing/family_docs/Glossary.md +206 -0
- md_processing/family_docs/Governance Officer/Create_Business_Imperative.md +106 -0
- md_processing/family_docs/Governance Officer/Create_Certification_Type.md +112 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Approach.md +114 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Obligation.md +114 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Principle.md +114 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Procedure.md +128 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Process.md +122 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Processing_Purpose.md +106 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Responsibility.md +122 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Rule.md +122 -0
- md_processing/family_docs/Governance Officer/Create_Governance_Strategy.md +106 -0
- md_processing/family_docs/Governance Officer/Create_License_Type.md +112 -0
- md_processing/family_docs/Governance Officer/Create_Naming_Standard_Rule.md +122 -0
- md_processing/family_docs/Governance Officer/Create_Regulation_Article.md +106 -0
- md_processing/family_docs/Governance Officer/Create_Regulation_Definition.md +118 -0
- md_processing/family_docs/Governance Officer/Create_Security_Access_Control.md +114 -0
- md_processing/family_docs/Governance Officer/Create_Security_Group.md +120 -0
- md_processing/family_docs/Governance Officer/Create_Service_Level_Objectives.md +122 -0
- md_processing/family_docs/Governance Officer/Create_Threat_Definition.md +106 -0
- md_processing/family_docs/Governance Officer/Link_Governance_Controls.md +32 -0
- md_processing/family_docs/Governance Officer/Link_Governance_Drivers.md +32 -0
- md_processing/family_docs/Governance Officer/Link_Governance_Policies.md +32 -0
- md_processing/family_docs/Governance Officer/View_Governance_Definitions.md +82 -0
- md_processing/family_docs/Governance Officer.md +2412 -0
- md_processing/family_docs/Solution Architect/Create_Information_Supply_Chain.md +70 -0
- md_processing/family_docs/Solution Architect/Create_Solution_Blueprint.md +44 -0
- md_processing/family_docs/Solution Architect/Create_Solution_Component.md +96 -0
- md_processing/family_docs/Solution Architect/Create_Solution_Role.md +66 -0
- md_processing/family_docs/Solution Architect/Link_Information_Supply_Chain_Peers.md +32 -0
- md_processing/family_docs/Solution Architect/Link_Solution_Component_Peers.md +32 -0
- md_processing/family_docs/Solution Architect/View_Information_Supply_Chains.md +32 -0
- md_processing/family_docs/Solution Architect/View_Solution_Blueprints.md +32 -0
- md_processing/family_docs/Solution Architect/View_Solution_Components.md +32 -0
- md_processing/family_docs/Solution Architect/View_Solution_Roles.md +32 -0
- md_processing/family_docs/Solution Architect.md +490 -0
- md_processing/md_commands/data_designer_commands.py +1192 -710
- md_processing/md_commands/glossary_commands.py +19 -32
- md_processing/md_commands/governance_officer_commands.py +420 -0
- md_processing/md_commands/product_manager_commands.py +1180 -0
- md_processing/md_commands/project_commands.py +5 -2
- md_processing/md_commands/solution_architect_commands.py +1140 -0
- md_processing/md_processing_utils/common_md_proc_utils.py +288 -96
- md_processing/md_processing_utils/common_md_utils.py +205 -6
- md_processing/md_processing_utils/debug_log +574 -0
- md_processing/md_processing_utils/dr-egeria-help-2025-07-17T17:22:09.md +2065 -0
- md_processing/md_processing_utils/extraction_utils.py +1 -1
- md_processing/md_processing_utils/generate_dr_help.py +165 -0
- md_processing/md_processing_utils/generate_md_cmd_templates.py +143 -0
- md_processing/md_processing_utils/generate_md_templates.py +92 -0
- md_processing/md_processing_utils/generated_help_terms.md +842 -0
- md_processing/md_processing_utils/md_processing_constants.py +94 -17
- pyegeria/__init__.py +1 -0
- pyegeria/_client.py +39 -1
- pyegeria/classification_manager_omvs.py +1 -1
- pyegeria/collection_manager_omvs.py +4667 -1178
- pyegeria/data_designer_omvs.py +348 -31
- pyegeria/egeria_tech_client.py +9 -25
- pyegeria/glossary_browser_omvs.py +5 -6
- pyegeria/glossary_manager_omvs.py +2 -2
- pyegeria/governance_officer_omvs.py +2367 -0
- pyegeria/output_formatter.py +157 -32
- pyegeria/solution_architect_omvs.py +5063 -1110
- pyegeria/utils.py +22 -2
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dist-info}/METADATA +3 -1
- pyegeria-5.4.0.dist-info/RECORD +243 -0
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dist-info}/entry_points.txt +5 -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/m_test.py +0 -118
- pyegeria-5.3.10.dist-info/RECORD +0 -196
- /commands/cat/{list_data_structures.py → list_data_structures_full.py} +0 -0
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dist-info}/WHEEL +0 -0
@@ -412,7 +412,7 @@ def get_element_by_name(egeria_client, element_type: str, element_name: str) ->
|
|
412
412
|
return q_name, guid, unique, exists
|
413
413
|
|
414
414
|
# Haven't seen this element before
|
415
|
-
property_names = ['qualifiedName', 'name', 'displayName']
|
415
|
+
property_names = ['qualifiedName', 'name', 'displayName', 'title']
|
416
416
|
open_metadata_type_name = None
|
417
417
|
details = egeria_client.get_elements_by_property_value(element_name, property_names, open_metadata_type_name)
|
418
418
|
if isinstance(details, str):
|
@@ -0,0 +1,165 @@
|
|
1
|
+
"""
|
2
|
+
This file contains general utility functions for processing Egeria Markdown
|
3
|
+
"""
|
4
|
+
import json
|
5
|
+
import os
|
6
|
+
import sys
|
7
|
+
from datetime import datetime
|
8
|
+
from typing import List
|
9
|
+
|
10
|
+
from loguru import logger
|
11
|
+
from rich import print
|
12
|
+
from rich.console import Console
|
13
|
+
from rich.markdown import Markdown
|
14
|
+
|
15
|
+
from commands.cat.dr_egeria_command_help import EGERIA_INBOX_PATH
|
16
|
+
from md_processing.md_processing_utils.common_md_utils import (get_current_datetime_string, get_element_dictionary,
|
17
|
+
update_element_dictionary,
|
18
|
+
split_tb_string, str_to_bool, )
|
19
|
+
from md_processing.md_processing_utils.extraction_utils import (process_simple_attribute, extract_attribute,
|
20
|
+
get_element_by_name)
|
21
|
+
from md_processing.md_processing_utils.md_processing_constants import (get_command_spec, load_commands, load_commands, COMMAND_DEFINITIONS)
|
22
|
+
|
23
|
+
from md_processing.md_processing_utils.message_constants import (ERROR, INFO, WARNING, ALWAYS, EXISTS_REQUIRED)
|
24
|
+
from pyegeria import EgeriaTech
|
25
|
+
from pyegeria._globals import DEBUG_LEVEL
|
26
|
+
from pyegeria.output_formatter import generate_entity_md_table
|
27
|
+
|
28
|
+
# Constants
|
29
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
30
|
+
EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", ".")
|
31
|
+
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", ".")
|
32
|
+
|
33
|
+
console = Console(width=EGERIA_WIDTH)
|
34
|
+
|
35
|
+
debug_level = DEBUG_LEVEL
|
36
|
+
global COMMAND_DEFINITIONS
|
37
|
+
|
38
|
+
load_commands('commands.json')
|
39
|
+
|
40
|
+
|
41
|
+
log_format = "D {time} | {level} | {function} | {line} | {message} | {extra}"
|
42
|
+
logger.remove()
|
43
|
+
logger.add(sys.stderr, level="INFO", format=log_format, colorize=True)
|
44
|
+
full_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_INBOX_PATH, "data_designer_debug.log")
|
45
|
+
# logger.add(full_file_path, rotation="1 day", retention="1 week", compression="zip", level="TRACE", format=log_format,
|
46
|
+
# colorize=True)
|
47
|
+
logger.add("debug_log", rotation="1 day", retention="1 week", compression="zip", level="TRACE", format=log_format,
|
48
|
+
colorize=True)
|
49
|
+
def get_iso8601_datetime():
|
50
|
+
"""Returns the current date and time in ISO 8601 format."""
|
51
|
+
return datetime.now().strftime('%Y-%m-%dT%H:%M:%S')
|
52
|
+
|
53
|
+
def yes_no(input: str)->str:
|
54
|
+
if type(input) is bool:
|
55
|
+
if input:
|
56
|
+
return "True"
|
57
|
+
else:
|
58
|
+
return "False"
|
59
|
+
|
60
|
+
input = input.title()
|
61
|
+
if input in ["Yes","No"]:
|
62
|
+
return input
|
63
|
+
|
64
|
+
if input in ["True", "T"]:
|
65
|
+
return "Yes"
|
66
|
+
else:
|
67
|
+
return "No"
|
68
|
+
|
69
|
+
@logger.catch
|
70
|
+
def _extract_help_fields(command: dict):
|
71
|
+
"""
|
72
|
+
|
73
|
+
"""
|
74
|
+
|
75
|
+
command_spec = get_command_spec(command)
|
76
|
+
attributes = command_spec.get('Attributes', [])
|
77
|
+
command_display_name = command_spec.get('display_name', None)
|
78
|
+
command_qn_prefix = command_spec.get('qn_prefix', None)
|
79
|
+
|
80
|
+
term_entry: list = []
|
81
|
+
for attr in attributes:
|
82
|
+
for key in attr:
|
83
|
+
if attr[key].get('level','Basic') != "Basic":
|
84
|
+
continue
|
85
|
+
attribute_name = key
|
86
|
+
input_required = yes_no(attr[key].get('input_required', "No"))
|
87
|
+
|
88
|
+
read_only = yes_no(attr[key].get('user_specified', "No"))
|
89
|
+
generated = yes_no(attr[key].get('generated', "No"))
|
90
|
+
default = attr[key].get('default', None)
|
91
|
+
if default:
|
92
|
+
generated = default
|
93
|
+
unique = yes_no(attr[key].get('unique', "No"))
|
94
|
+
notes = attr[key].get('description', "")
|
95
|
+
valid_values = attr[key].get('valid_values', [])
|
96
|
+
term_entry.append ({
|
97
|
+
'Attribute Name' : attribute_name,
|
98
|
+
'Input Required' : input_required,
|
99
|
+
'Read Only' : read_only,
|
100
|
+
'Generated' : generated,
|
101
|
+
'Default Value' : default,
|
102
|
+
'Notes' : notes,
|
103
|
+
'Unique Values' : unique,
|
104
|
+
'Valid Values' : valid_values,
|
105
|
+
})
|
106
|
+
|
107
|
+
return term_entry
|
108
|
+
|
109
|
+
def create_help_terms():
|
110
|
+
term_entry:str = ""
|
111
|
+
glossary_name = "Egeria-Markdown"
|
112
|
+
commands = COMMAND_DEFINITIONS["Command Specifications"]
|
113
|
+
columns = [{'name': "Attribute Name", 'key': 'Attribute Name'},
|
114
|
+
{'name': 'Input Required', 'key': 'Input Required'},
|
115
|
+
{'name': 'Read Only', 'key': 'Read Only'},
|
116
|
+
{'name': 'Generated', 'key': 'Generated'},
|
117
|
+
{'name': 'Default Value', 'key': 'Default Value'},
|
118
|
+
{'name': 'Notes', 'key': 'Notes'},
|
119
|
+
{'name': 'Unique Values', 'key': 'Unique Values'},
|
120
|
+
{'name': 'Valid Values', 'key': 'Valid Values'}]
|
121
|
+
|
122
|
+
term_entry = """# Generating glossary entries for the documented commands\n\n
|
123
|
+
This file contains generated Dr.Egeria commands to generate glossary term entries describing
|
124
|
+
each Dr.Egeria command.
|
125
|
+
|
126
|
+
> Usage: Before executing this file, make sure you have a glossary named `Egeria-Markdown`
|
127
|
+
> already created. If you Need to create one, you can use the \n"""
|
128
|
+
|
129
|
+
for command, values in commands.items():
|
130
|
+
if command == "exported":
|
131
|
+
continue
|
132
|
+
if commands[command].get("level","") not in ["Basic"]:
|
133
|
+
continue
|
134
|
+
command_description = commands[command].get("description","")
|
135
|
+
command_verb = commands[command].get("verb","")
|
136
|
+
|
137
|
+
term_entry+= "# Create Term\n"
|
138
|
+
term_entry+= f"## Term Name\n\n{command}\n\n"
|
139
|
+
term_entry+= f"## Description\n\n{command_description}\n\n"
|
140
|
+
term_entry+= f"## Owning Glossary\n\n{glossary_name}\n\n"
|
141
|
+
term_entry+= f"## Categories\n\nWriting Dr.Egeria Markdown\n\n"
|
142
|
+
|
143
|
+
|
144
|
+
du = _extract_help_fields(command)
|
145
|
+
output = generate_entity_md_table(du, "", "", _extract_help_fields, columns, None, "help" )
|
146
|
+
|
147
|
+
term_entry+= f"## Usage\n\n{output}\n\n___\n\n"
|
148
|
+
print(term_entry)
|
149
|
+
# Generate filename with current date and time in ISO 8601 format
|
150
|
+
current_datetime = get_iso8601_datetime()
|
151
|
+
filename = f"dr-egeria-help-{current_datetime}.md"
|
152
|
+
file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_INBOX_PATH, filename)
|
153
|
+
|
154
|
+
# Write the content to the file
|
155
|
+
with open(file_path, 'w', encoding="utf-8") as f:
|
156
|
+
f.write(term_entry)
|
157
|
+
|
158
|
+
logger.info(f"Help documentation saved to {file_path}")
|
159
|
+
|
160
|
+
def main():
|
161
|
+
create_help_terms()
|
162
|
+
|
163
|
+
|
164
|
+
if __name__ == "__main__":
|
165
|
+
main()
|
@@ -0,0 +1,143 @@
|
|
1
|
+
"""
|
2
|
+
This file contains general utility functions for processing Egeria Markdown
|
3
|
+
"""
|
4
|
+
import os
|
5
|
+
import sys
|
6
|
+
from typing import List, Dict
|
7
|
+
import io
|
8
|
+
|
9
|
+
from loguru import logger
|
10
|
+
from rich import print
|
11
|
+
from rich.console import Console
|
12
|
+
|
13
|
+
from commands.cat.dr_egeria_command_help import EGERIA_INBOX_PATH
|
14
|
+
from md_processing.md_processing_utils.common_md_utils import (get_current_datetime_string, get_element_dictionary,
|
15
|
+
update_element_dictionary,
|
16
|
+
split_tb_string, str_to_bool, )
|
17
|
+
from md_processing.md_processing_utils.extraction_utils import (process_simple_attribute, extract_attribute,
|
18
|
+
get_element_by_name)
|
19
|
+
from md_processing.md_processing_utils.md_processing_constants import (get_command_spec, load_commands, load_commands, COMMAND_DEFINITIONS)
|
20
|
+
|
21
|
+
from md_processing.md_processing_utils.message_constants import (ERROR, INFO, WARNING, ALWAYS, EXISTS_REQUIRED)
|
22
|
+
from pyegeria import EgeriaTech
|
23
|
+
from pyegeria._globals import DEBUG_LEVEL
|
24
|
+
|
25
|
+
|
26
|
+
# Constants
|
27
|
+
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
28
|
+
EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", ".")
|
29
|
+
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", ".")
|
30
|
+
|
31
|
+
console = Console(width=EGERIA_WIDTH)
|
32
|
+
|
33
|
+
debug_level = DEBUG_LEVEL
|
34
|
+
global COMMAND_DEFINITIONS
|
35
|
+
|
36
|
+
load_commands('commands.json')
|
37
|
+
|
38
|
+
|
39
|
+
log_format = "D {time} | {level} | {function} | {line} | {message} | {extra}"
|
40
|
+
logger.remove()
|
41
|
+
logger.add(sys.stderr, level="INFO", format=log_format, colorize=True)
|
42
|
+
full_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_INBOX_PATH, "data_designer_debug.log")
|
43
|
+
# logger.add(full_file_path, rotation="1 day", retention="1 week", compression="zip", level="TRACE", format=log_format,
|
44
|
+
# colorize=True)
|
45
|
+
logger.add("debug_log", rotation="1 day", retention="1 week", compression="zip", level="TRACE", format=log_format,
|
46
|
+
colorize=True)
|
47
|
+
@logger.catch
|
48
|
+
def main():
|
49
|
+
"""
|
50
|
+
Generate markdown command templates organized by family
|
51
|
+
"""
|
52
|
+
glossary_name = "Egeria-Markdown"
|
53
|
+
commands = COMMAND_DEFINITIONS["Command Specifications"]
|
54
|
+
|
55
|
+
# Create base output directory if it doesn't exist
|
56
|
+
base_output_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "family_docs")
|
57
|
+
os.makedirs(base_output_dir, exist_ok=True)
|
58
|
+
|
59
|
+
# Group commands by family
|
60
|
+
families = {}
|
61
|
+
for command, values in commands.items():
|
62
|
+
if command == "exported":
|
63
|
+
continue
|
64
|
+
if values.get("level", "") not in ["Basic"]:
|
65
|
+
continue
|
66
|
+
|
67
|
+
family = values.get("family", "Other")
|
68
|
+
if family not in families:
|
69
|
+
families[family] = []
|
70
|
+
|
71
|
+
families[family].append(command)
|
72
|
+
|
73
|
+
# Process each family
|
74
|
+
for family, command_list in sorted(families.items()):
|
75
|
+
# Create a folder for each family
|
76
|
+
family_dir = os.path.join(base_output_dir, family)
|
77
|
+
os.makedirs(family_dir, exist_ok=True)
|
78
|
+
|
79
|
+
print(f"\n# Family: {family}\n")
|
80
|
+
|
81
|
+
# Process each command in the family
|
82
|
+
for command in sorted(command_list):
|
83
|
+
values = commands[command]
|
84
|
+
command_description = values.get("description", "")
|
85
|
+
command_verb = values.get("verb", "")
|
86
|
+
|
87
|
+
# Create a string buffer for the command's output
|
88
|
+
command_output = io.StringIO()
|
89
|
+
|
90
|
+
# Write command header
|
91
|
+
command_output.write(f"# **{command}**\n>\t{command_description}\n")
|
92
|
+
print(f"\n## {command_verb} **{command}**\n>\t{command_description}")
|
93
|
+
|
94
|
+
# Process command attributes
|
95
|
+
attributes = values['Attributes']
|
96
|
+
for attribute in attributes:
|
97
|
+
for key, value in attribute.items():
|
98
|
+
if value.get('level', "") not in ["Basic"]:
|
99
|
+
continue
|
100
|
+
user_specified = value.get('user_specified', 'true') in ["true", "True"]
|
101
|
+
|
102
|
+
command_output.write(f"\n## **{key}**\n")
|
103
|
+
print(f"\n### **{key}**")
|
104
|
+
|
105
|
+
command_output.write(f">\t**Input Required**: {value.get('input_required', 'false')}\n\n")
|
106
|
+
print(f">\tInput Required: {value.get('input_required', 'false')}")
|
107
|
+
|
108
|
+
command_output.write(f">\t**Description**: {value.get('description', '')}\n\n")
|
109
|
+
print(f">\tDescription: {value.get('description', '')}")
|
110
|
+
|
111
|
+
labels = value.get("attr_labels", None)
|
112
|
+
if labels:
|
113
|
+
command_output.write(f">\t**Alternative Labels**: {labels}\n\n")
|
114
|
+
print(f">\tAlternative Labels: {labels}")
|
115
|
+
|
116
|
+
valid_values = value.get("valid_values", None)
|
117
|
+
if valid_values:
|
118
|
+
command_output.write(f">\t**Valid Values**: {valid_values}\n\n")
|
119
|
+
print(f">\tValid Values: {valid_values}")
|
120
|
+
|
121
|
+
default_value = value.get("default_value", None)
|
122
|
+
if default_value:
|
123
|
+
command_output.write(f">\t**Default Value**: {default_value}\n\n")
|
124
|
+
print(f">\tDefault Value: {default_value}")
|
125
|
+
|
126
|
+
# Save the command to its own file in the family directory
|
127
|
+
# Use a sanitized version of the command name for the filename
|
128
|
+
command_filename = command.replace(" ", "_").replace(":", "").replace("/", "_")
|
129
|
+
command_file_path = os.path.join(family_dir, f"{command_filename}.md")
|
130
|
+
|
131
|
+
with open(command_file_path, 'w') as f:
|
132
|
+
f.write(command_output.getvalue())
|
133
|
+
|
134
|
+
logger.info(f"Saved command documentation to {command_file_path}")
|
135
|
+
print("\n___\n")
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
#
|
141
|
+
|
142
|
+
if __name__ == "__main__":
|
143
|
+
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()
|