pyegeria 5.3.10__py3-none-any.whl → 5.4.0.dev3__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/debug_log.log +1267 -0
- commands/cat/dr_egeria_md.py +32 -5
- commands/cat/list_collections.py +10 -4
- commands/cat/list_data_designer.py +172 -0
- commands/cat/solution_architect_log.log +0 -0
- md_processing/__init__.py +7 -2
- md_processing/data/commands.json +4666 -848
- md_processing/dr_egeria_inbox/data_designer_search_test.md +11 -0
- md_processing/dr_egeria_inbox/data_test.md +106 -13
- md_processing/dr_egeria_inbox/data_test2.md +376 -0
- md_processing/dr_egeria_inbox/{search_test.md → glossary_search_test.md} +1 -0
- md_processing/dr_egeria_inbox/solution-components.md +66 -91
- 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.10.dist-info → pyegeria-5.4.0.dev3.dist-info}/METADATA +2 -1
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dev3.dist-info}/RECORD +35 -36
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dev3.dist-info}/entry_points.txt +4 -0
- 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
- /commands/cat/{list_data_structures.py → list_data_structures_full.py} +0 -0
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dev3.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.10.dist-info → pyegeria-5.4.0.dev3.dist-info}/WHEEL +0 -0
@@ -1,303 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
This file contains blueprint/solution-related object_action functions for processing Egeria Markdown
|
3
|
-
"""
|
4
|
-
from typing import Optional
|
5
|
-
|
6
|
-
from rich.markdown import Markdown
|
7
|
-
|
8
|
-
from pyegeria.egeria_tech_client import EgeriaTech
|
9
|
-
from md_processing.md_processing_utils.common_md_utils import (
|
10
|
-
debug_level, print_msg, update_element_dictionary
|
11
|
-
)
|
12
|
-
from md_processing.md_processing_utils.extraction_utils import (
|
13
|
-
extract_command_plus, process_simple_attribute, process_name_list, process_element_identifiers, update_a_command
|
14
|
-
)
|
15
|
-
|
16
|
-
from md_processing.md_processing_utils.md_processing_constants import (
|
17
|
-
BLUEPRINT_NAME_LABELS, COMPONENT_NAME_LABELS, ALWAYS, ERROR, INFO, pre_command, EXISTS_REQUIRED,
|
18
|
-
)
|
19
|
-
|
20
|
-
def process_blueprint_upsert_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[str]:
|
21
|
-
"""
|
22
|
-
Processes a solution blueprint create or update object_action by extracting key attributes such as
|
23
|
-
blueprint name, description, and usage from the given text.
|
24
|
-
|
25
|
-
:param txt: A string representing the input cell to be processed for
|
26
|
-
extracting blueprint-related attributes.
|
27
|
-
:param directive: an optional string indicating the directive to be used - display, validate or execute
|
28
|
-
:return: A string summarizing the outcome of the processing.
|
29
|
-
"""
|
30
|
-
from md_processing.md_processing_utils.common_md_utils import set_debug_level
|
31
|
-
|
32
|
-
command, object_type, object_action = extract_command_plus(txt)
|
33
|
-
set_debug_level(directive)
|
34
|
-
|
35
|
-
blueprint_name = process_simple_attribute(txt, BLUEPRINT_NAME_LABELS, ERROR)
|
36
|
-
print(Markdown(f"{pre_command} `{object_action}` `{object_type}` for blueprint: `\'{blueprint_name}\'` with directive: `{directive}` "))
|
37
|
-
description = process_simple_attribute(txt, ['Description'], INFO)
|
38
|
-
usage = process_simple_attribute(txt, ['Usage'], INFO)
|
39
|
-
q_name = process_simple_attribute(txt, ['Qualified Name'], INFO)
|
40
|
-
valid = True
|
41
|
-
|
42
|
-
if blueprint_name is None:
|
43
|
-
valid = False
|
44
|
-
known_q_name = None
|
45
|
-
known_guid = None
|
46
|
-
blueprint_exists = False
|
47
|
-
else:
|
48
|
-
element_labels = BLUEPRINT_NAME_LABELS
|
49
|
-
element_labels.append('Display Name')
|
50
|
-
known_q_name, known_guid, valid, blueprint_exists = process_element_identifiers(egeria_client, object_type,
|
51
|
-
element_labels, txt,
|
52
|
-
object_action, None)
|
53
|
-
|
54
|
-
blueprint_display = (f"\n* Command: `{command}`\n\t* Blueprint Name: {blueprint_name}\n\t"
|
55
|
-
f"* Description: {description}\n\t* Usage: {usage}\n")
|
56
|
-
|
57
|
-
if object_action == 'Update':
|
58
|
-
guid = process_simple_attribute(txt, ['GUID', 'guid', 'Guid'])
|
59
|
-
blueprint_display += f"* Qualified Name: `{q_name}`\n\t* GUID: {guid}\n\n"
|
60
|
-
if not blueprint_exists:
|
61
|
-
msg = f"Blueprint can't be updated; `{blueprint_name}` not found"
|
62
|
-
print_msg("ERROR", msg, debug_level)
|
63
|
-
valid = False
|
64
|
-
else:
|
65
|
-
msg = f"Blueprint can be updated; `{blueprint_name}` found"
|
66
|
-
print_msg(ALWAYS, msg, debug_level)
|
67
|
-
|
68
|
-
elif object_action == "Create":
|
69
|
-
if blueprint_exists:
|
70
|
-
msg = f"Blueprint `{blueprint_name}` can't be created because it already exists.\n"
|
71
|
-
print_msg("ERROR", msg, debug_level)
|
72
|
-
valid = False
|
73
|
-
elif valid:
|
74
|
-
msg = f"It is valid to create Blueprint `{blueprint_name}` with:\n"
|
75
|
-
print_msg("ALWAYS", msg, debug_level)
|
76
|
-
|
77
|
-
if directive == "display":
|
78
|
-
print(Markdown(blueprint_display))
|
79
|
-
return None
|
80
|
-
|
81
|
-
elif directive == "validate":
|
82
|
-
if valid:
|
83
|
-
print(Markdown(blueprint_display))
|
84
|
-
else:
|
85
|
-
msg = f"Validation failed for Blueprint `{blueprint_name}`\n"
|
86
|
-
print_msg(ERROR, msg, debug_level)
|
87
|
-
print(Markdown(blueprint_display))
|
88
|
-
|
89
|
-
return valid
|
90
|
-
|
91
|
-
elif directive == "process":
|
92
|
-
if valid:
|
93
|
-
print(Markdown(blueprint_display))
|
94
|
-
else:
|
95
|
-
if blueprint_exists and object_action == "Create":
|
96
|
-
msg = f"Create failed because blueprint `{blueprint_name}` exists - changing `Create` to `Update` in processed output \n"
|
97
|
-
print_msg(ERROR, msg, debug_level)
|
98
|
-
print(Markdown(blueprint_display))
|
99
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
100
|
-
else:
|
101
|
-
return None
|
102
|
-
|
103
|
-
if object_action == "Update":
|
104
|
-
if not blueprint_exists:
|
105
|
-
print(f"\n{ERROR}Blueprint `{blueprint_name}` does not exist! Updating result document with Create "
|
106
|
-
f"object_action\n")
|
107
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
108
|
-
|
109
|
-
body = {
|
110
|
-
"class": "ReferenceableRequestBody", "elementProperties": {
|
111
|
-
"class": "SolutionBlueprintProperties", "qualifiedName": known_q_name, "description": description,
|
112
|
-
"usage": usage
|
113
|
-
}
|
114
|
-
}
|
115
|
-
egeria_client.update_solution_blueprint(known_guid, body)
|
116
|
-
print_msg(ALWAYS, f"Updated Blueprint `{blueprint_name}` with GUID {known_guid}", debug_level)
|
117
|
-
update_element_dictionary(known_q_name, {
|
118
|
-
'guid': known_guid, 'display_name': blueprint_name
|
119
|
-
})
|
120
|
-
return egeria_client.get_solution_blueprint_by_guid(known_guid, output_format='MD')
|
121
|
-
|
122
|
-
elif object_action == "Create":
|
123
|
-
if blueprint_exists:
|
124
|
-
print(f"\nBlueprint `{blueprint_name}` already exists and result document updated\n")
|
125
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
126
|
-
else:
|
127
|
-
blueprint_guid = egeria_client.create_solution_blueprint(blueprint_name, description, usage)
|
128
|
-
if blueprint_guid:
|
129
|
-
print_msg(ALWAYS, f"Created Blueprint `{blueprint_name}` with GUID {blueprint_guid}", debug_level)
|
130
|
-
return egeria_client.get_solution_blueprint_by_guid(blueprint_guid, output_format='MD')
|
131
|
-
else:
|
132
|
-
print_msg(ERROR, f"Failed to create Blueprint `{blueprint_name}`", debug_level)
|
133
|
-
return None
|
134
|
-
|
135
|
-
|
136
|
-
def process_solution_component_upsert_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[str]:
|
137
|
-
"""
|
138
|
-
Processes a solution component create or update object_action by extracting key attributes such as
|
139
|
-
component name, description, and parent components from the given text.
|
140
|
-
|
141
|
-
:param txt: A string representing the input cell to be processed for
|
142
|
-
extracting component-related attributes.
|
143
|
-
:param directive: an optional string indicating the directive to be used - display, validate or execute
|
144
|
-
:return: A string summarizing the outcome of the processing.
|
145
|
-
"""
|
146
|
-
from md_processing.md_processing_utils.common_md_utils import set_debug_level
|
147
|
-
|
148
|
-
command, object_type, object_action = extract_command_plus(txt)
|
149
|
-
set_debug_level(directive)
|
150
|
-
|
151
|
-
component_name = process_simple_attribute(txt, COMPONENT_NAME_LABELS, ERROR)
|
152
|
-
print(Markdown(f"{pre_command} `{object_action}` `{object_type}` for component: `\'{component_name}\'` with directive: `{directive}` "))
|
153
|
-
description = process_simple_attribute(txt, ['Description'], INFO)
|
154
|
-
q_name = process_simple_attribute(txt, ['Qualified Name'], INFO)
|
155
|
-
valid = True
|
156
|
-
|
157
|
-
if component_name is None:
|
158
|
-
valid = False
|
159
|
-
known_q_name = None
|
160
|
-
known_guid = None
|
161
|
-
component_exists = False
|
162
|
-
else:
|
163
|
-
element_labels = COMPONENT_NAME_LABELS
|
164
|
-
element_labels.append('Display Name')
|
165
|
-
known_q_name, known_guid, valid, component_exists = process_element_identifiers(egeria_client, object_type,
|
166
|
-
element_labels, txt,
|
167
|
-
object_action, None)
|
168
|
-
|
169
|
-
# Get the blueprint this component is in
|
170
|
-
blueprint_name = process_simple_attribute(txt, BLUEPRINT_NAME_LABELS)
|
171
|
-
if blueprint_name:
|
172
|
-
known_blueprint_q_name, known_blueprint_guid, blueprint_valid, blueprint_exists = process_element_identifiers(
|
173
|
-
egeria_client, "Solution Blueprint", BLUEPRINT_NAME_LABELS, txt, EXISTS_REQUIRED, None)
|
174
|
-
if not blueprint_exists:
|
175
|
-
valid = False
|
176
|
-
else:
|
177
|
-
known_blueprint_q_name = None
|
178
|
-
known_blueprint_guid = None
|
179
|
-
blueprint_valid = True
|
180
|
-
blueprint_exists = False
|
181
|
-
|
182
|
-
# Get the parent components if specified
|
183
|
-
parent_components = process_simple_attribute(txt, ['Parent Components', 'Parent Component'])
|
184
|
-
if parent_components:
|
185
|
-
parent_components_list, parent_q_name_list, parents_valid, parents_exist = process_name_list(
|
186
|
-
egeria_client, 'Solution Components', txt, COMPONENT_NAME_LABELS)
|
187
|
-
if not parents_exist:
|
188
|
-
valid = False
|
189
|
-
else:
|
190
|
-
parent_components_list = None
|
191
|
-
parent_q_name_list = None
|
192
|
-
parents_valid = True
|
193
|
-
parents_exist = False
|
194
|
-
|
195
|
-
component_display = (f"\n* Command: `{command}`\n\t* Component Name: {component_name}\n\t"
|
196
|
-
f"* Blueprint: {blueprint_name}\n\t* Parent Components: {parent_components}\n\t"
|
197
|
-
f"* Description: {description}\n")
|
198
|
-
|
199
|
-
if object_action == 'Update':
|
200
|
-
guid = process_simple_attribute(txt, ['GUID', 'guid', 'Guid'])
|
201
|
-
component_display += f"* Qualified Name: `{q_name}`\n\t* GUID: {guid}\n\n"
|
202
|
-
if not component_exists:
|
203
|
-
msg = f"Component can't be updated; `{component_name}` not found"
|
204
|
-
print_msg("ERROR", msg, debug_level)
|
205
|
-
valid = False
|
206
|
-
else:
|
207
|
-
msg = f"Component can be updated; `{component_name}` found"
|
208
|
-
print_msg(ALWAYS, msg, debug_level)
|
209
|
-
|
210
|
-
elif object_action == "Create":
|
211
|
-
if component_exists:
|
212
|
-
msg = f"Component `{component_name}` can't be created because it already exists.\n"
|
213
|
-
print_msg("ERROR", msg, debug_level)
|
214
|
-
valid = False
|
215
|
-
elif valid:
|
216
|
-
msg = f"It is valid to create Component `{component_name}` with:\n"
|
217
|
-
print_msg("ALWAYS", msg, debug_level)
|
218
|
-
|
219
|
-
if directive == "display":
|
220
|
-
print(Markdown(component_display))
|
221
|
-
return None
|
222
|
-
|
223
|
-
elif directive == "validate":
|
224
|
-
if valid:
|
225
|
-
print(Markdown(component_display))
|
226
|
-
else:
|
227
|
-
msg = f"Validation failed for Component `{component_name}`\n"
|
228
|
-
print_msg(ERROR, msg, debug_level)
|
229
|
-
print(Markdown(component_display))
|
230
|
-
|
231
|
-
return valid
|
232
|
-
|
233
|
-
elif directive == "process":
|
234
|
-
if valid:
|
235
|
-
print(Markdown(component_display))
|
236
|
-
else:
|
237
|
-
if component_exists and object_action == "Create":
|
238
|
-
msg = f"Create failed because component `{component_name}` exists - changing `Create` to `Update` in processed output \n"
|
239
|
-
print_msg(ERROR, msg, debug_level)
|
240
|
-
print(Markdown(component_display))
|
241
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
242
|
-
else:
|
243
|
-
return None
|
244
|
-
|
245
|
-
if object_action == "Update":
|
246
|
-
if not component_exists:
|
247
|
-
print(f"\n{ERROR}Component `{component_name}` does not exist! Updating result document with Create "
|
248
|
-
f"object_action\n")
|
249
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
250
|
-
|
251
|
-
body = {
|
252
|
-
"class": "ReferenceableRequestBody", "elementProperties": {
|
253
|
-
"class": "SolutionComponentProperties", "qualifiedName": known_q_name, "description": description
|
254
|
-
}
|
255
|
-
}
|
256
|
-
egeria_client.update_solution_component(known_guid, body)
|
257
|
-
print_msg(ALWAYS, f"Updated Component `{component_name}` with GUID {known_guid}", debug_level)
|
258
|
-
update_element_dictionary(known_q_name, {
|
259
|
-
'guid': known_guid, 'display_name': component_name
|
260
|
-
})
|
261
|
-
|
262
|
-
# Update parent components if specified
|
263
|
-
if parent_components and parents_exist and parents_valid:
|
264
|
-
# Get the current parent components
|
265
|
-
component_details = egeria_client.get_solution_component_by_guid(known_guid)
|
266
|
-
current_parents = []
|
267
|
-
if 'parentComponents' in component_details:
|
268
|
-
for parent in component_details['parentComponents']:
|
269
|
-
current_parents.append(parent.get('guid', None))
|
270
|
-
|
271
|
-
# Add new parent components
|
272
|
-
for parent in parent_q_name_list:
|
273
|
-
if parent not in current_parents:
|
274
|
-
egeria_client.add_parent_component(parent, known_guid)
|
275
|
-
print_msg(INFO, f"Added parent component to {component_name}", debug_level)
|
276
|
-
|
277
|
-
# Remove parent components that are not in the new list
|
278
|
-
for parent in current_parents:
|
279
|
-
if parent not in parent_q_name_list:
|
280
|
-
egeria_client.remove_parent_component(parent, known_guid)
|
281
|
-
print_msg(INFO, f"Removed parent component from {component_name}", debug_level)
|
282
|
-
|
283
|
-
return egeria_client.get_solution_component_by_guid(known_guid, output_format='MD')
|
284
|
-
|
285
|
-
elif object_action == "Create":
|
286
|
-
if component_exists:
|
287
|
-
print(f"\nComponent `{component_name}` already exists and result document updated\n")
|
288
|
-
return update_a_command(txt, object_action, object_type, known_q_name, known_guid)
|
289
|
-
else:
|
290
|
-
component_guid = egeria_client.create_solution_component(component_name, description, known_blueprint_guid)
|
291
|
-
if component_guid:
|
292
|
-
print_msg(ALWAYS, f"Created Component `{component_name}` with GUID {component_guid}", debug_level)
|
293
|
-
|
294
|
-
# Add parent components if specified
|
295
|
-
if parent_components and parents_exist and parents_valid:
|
296
|
-
for parent in parent_q_name_list:
|
297
|
-
egeria_client.add_parent_component(parent, component_guid)
|
298
|
-
print_msg(INFO, f"Added parent component to {component_name}", debug_level)
|
299
|
-
|
300
|
-
return egeria_client.get_solution_component_by_guid(component_guid, output_format='MD')
|
301
|
-
else:
|
302
|
-
print_msg(ERROR, f"Failed to create Component `{component_name}`", debug_level)
|
303
|
-
return None
|
File without changes
|
File without changes
|
File without changes
|