pyegeria 5.4.0.22__py3-none-any.whl → 5.4.0.24__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.
Files changed (130) hide show
  1. commands/cat/.DS_Store +0 -0
  2. commands/cat/.env +8 -0
  3. commands/cat/debug_log +2046 -465
  4. commands/cat/debug_log.2025-08-15_09-14-07_444802.zip +0 -0
  5. commands/cat/debug_log.2025-08-16_10-21-59_388912.zip +0 -0
  6. commands/cat/debug_log.log +0 -0
  7. commands/cat/dr_egeria_md.py +16 -3
  8. commands/cat/list_collections.py +15 -6
  9. commands/cat/list_format_set.py +90 -85
  10. commands/cli/debug_log.log +0 -0
  11. commands/ops/logs/pyegeria.log +0 -0
  12. md_processing/.DS_Store +0 -0
  13. md_processing/__init__.py +5 -3
  14. md_processing/data/commands.json +8310 -903
  15. md_processing/dr-egeria-outbox/Collections-2025-08-12-13-30-37.md +163 -0
  16. md_processing/dr-egeria-outbox/Collections-2025-08-12-13-35-58.md +474 -0
  17. md_processing/dr_egeria_inbox/Derive-Dr-Gov-Defs.md +8 -0
  18. md_processing/dr_egeria_inbox/Dr.Egeria Templates.md +873 -0
  19. md_processing/dr_egeria_inbox/arch_test.md +57 -0
  20. md_processing/dr_egeria_inbox/archive/dr_egeria_intro.md +254 -0
  21. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_more_terms.md +696 -0
  22. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part1.md +254 -0
  23. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part2.md +298 -0
  24. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part3.md +608 -0
  25. md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part4.md +94 -0
  26. md_processing/dr_egeria_inbox/archive/freddie_intro.md +284 -0
  27. md_processing/dr_egeria_inbox/archive/freddie_intro_orig.md +275 -0
  28. md_processing/dr_egeria_inbox/archive/test-term.md +110 -0
  29. md_processing/dr_egeria_inbox/cat_test.md +100 -0
  30. md_processing/dr_egeria_inbox/collections.md +39 -0
  31. md_processing/dr_egeria_inbox/data_designer_debug.log +6 -0
  32. md_processing/dr_egeria_inbox/data_designer_out.md +60 -0
  33. md_processing/dr_egeria_inbox/data_designer_search_test.md +11 -0
  34. md_processing/dr_egeria_inbox/data_field.md +54 -0
  35. md_processing/dr_egeria_inbox/data_spec.md +77 -0
  36. md_processing/dr_egeria_inbox/data_spec_test.md +2406 -0
  37. md_processing/dr_egeria_inbox/data_test.md +179 -0
  38. md_processing/dr_egeria_inbox/data_test2.md +429 -0
  39. md_processing/dr_egeria_inbox/data_test3.md +462 -0
  40. md_processing/dr_egeria_inbox/dr_egeria_data_designer_1.md +124 -0
  41. md_processing/dr_egeria_inbox/dr_egeria_intro_categories.md +168 -0
  42. md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +280 -0
  43. md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +313 -0
  44. md_processing/dr_egeria_inbox/dr_egeria_intro_part3.md +1073 -0
  45. md_processing/dr_egeria_inbox/dr_egeria_isc1.md +44 -0
  46. md_processing/dr_egeria_inbox/generated_help_report.md +9 -0
  47. md_processing/dr_egeria_inbox/glossary_list.md +5 -0
  48. md_processing/dr_egeria_inbox/glossary_search_test.md +40 -0
  49. md_processing/dr_egeria_inbox/glossary_test1.md +324 -0
  50. md_processing/dr_egeria_inbox/gov_def.md +482 -0
  51. md_processing/dr_egeria_inbox/gov_def2.md +447 -0
  52. md_processing/dr_egeria_inbox/img.png +0 -0
  53. md_processing/dr_egeria_inbox/product.md +162 -0
  54. md_processing/dr_egeria_inbox/rel.md +8 -0
  55. md_processing/dr_egeria_inbox/sb.md +119 -0
  56. md_processing/dr_egeria_inbox/solution-components.md +136 -0
  57. md_processing/dr_egeria_inbox/solution_blueprints.md +118 -0
  58. md_processing/dr_egeria_inbox/synonym_test.md +42 -0
  59. md_processing/dr_egeria_inbox/t2.md +268 -0
  60. md_processing/dr_egeria_outbox/.obsidian/app.json +1 -0
  61. md_processing/dr_egeria_outbox/.obsidian/appearance.json +1 -0
  62. md_processing/dr_egeria_outbox/.obsidian/community-plugins.json +6 -0
  63. md_processing/dr_egeria_outbox/.obsidian/core-plugins.json +31 -0
  64. md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/data.json +10 -0
  65. md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/main.js +4459 -0
  66. md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/manifest.json +10 -0
  67. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/data.json +3 -0
  68. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/main.js +153 -0
  69. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/manifest.json +11 -0
  70. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/styles.css +1 -0
  71. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/main.js +500 -0
  72. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +12 -0
  73. md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/styles.css +1 -0
  74. md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/main.js +37 -0
  75. md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/manifest.json +11 -0
  76. md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/styles.css +220 -0
  77. md_processing/dr_egeria_outbox/.obsidian/types.json +28 -0
  78. md_processing/dr_egeria_outbox/.obsidian/workspace.json +220 -0
  79. md_processing/dr_egeria_outbox/Untitled.canvas +1 -0
  80. md_processing/dr_egeria_outbox/monday/processed-2025-07-14 12:38-data_designer_out.md +663 -0
  81. md_processing/dr_egeria_outbox/monday/processed-2025-07-21 10:52-generated_help_report.md +2744 -0
  82. md_processing/dr_egeria_outbox/monday/processed-2025-07-21 18:38-collections.md +62 -0
  83. md_processing/dr_egeria_outbox/monday/processed-2025-08-01 11:34-gov_def.md +444 -0
  84. md_processing/dr_egeria_outbox/monday/processed-2025-08-17 21:04-product.md +97 -0
  85. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 14:55-product.md +77 -0
  86. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 15:05-product.md +75 -0
  87. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 15:11-product.md +74 -0
  88. md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 20:40-collections.md +49 -0
  89. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 15:00-Derive-Dr-Gov-Defs.md +719 -0
  90. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:13-Derive-Dr-Gov-Defs.md +41 -0
  91. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:14-Derive-Dr-Gov-Defs.md +33 -0
  92. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:50-Derive-Dr-Gov-Defs.md +192 -0
  93. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 22:08-gov_def2.md +486 -0
  94. md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 22:10-gov_def2.md +486 -0
  95. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 08:53-gov_def2.md +486 -0
  96. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 08:54-gov_def2.md +486 -0
  97. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:03-gov_def2.md +486 -0
  98. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:06-gov_def2.md +486 -0
  99. md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:10-gov_def2.md +486 -0
  100. md_processing/dr_egeria_outbox/tuesday/processed-2025-07-16 19:15-gov_def2.md +527 -0
  101. md_processing/dr_egeria_outbox/tuesday/processed-2025-07-17 12:08-gov_def2.md +527 -0
  102. md_processing/dr_egeria_outbox/tuesday/processed-2025-07-17 14:27-gov_def2.md +485 -0
  103. md_processing/md_commands/governance_officer_commands.py +291 -150
  104. md_processing/md_commands/product_manager_commands.py +309 -401
  105. md_processing/md_processing_utils/common_md_proc_utils.py +110 -7
  106. md_processing/md_processing_utils/common_md_utils.py +112 -26
  107. md_processing/md_processing_utils/debug_log.log +0 -0
  108. md_processing/md_processing_utils/md_processing_constants.py +8 -5
  109. md_processing/md_processing_utils/solution_architect_log.log +0 -0
  110. pyegeria/.DS_Store +0 -0
  111. pyegeria/__init__.py +3 -3
  112. pyegeria/_client_new.py +48 -51
  113. pyegeria/_exceptions_new.py +6 -0
  114. pyegeria/_output_format_models.py +22 -17
  115. pyegeria/_output_formats.py +122 -34
  116. pyegeria/collection_manager.py +154 -50
  117. pyegeria/collection_manager_omvs.py +47 -18
  118. pyegeria/egeria_cat_client.py +1 -1
  119. pyegeria/egeria_client.py +6 -0
  120. pyegeria/egeria_tech_client.py +6 -1
  121. pyegeria/governance_officer.py +2513 -0
  122. pyegeria/load_config.py +1 -1
  123. pyegeria/models.py +48 -5
  124. pyegeria/output_formatter.py +298 -79
  125. pyegeria/utils.py +1 -1
  126. {pyegeria-5.4.0.22.dist-info → pyegeria-5.4.0.24.dist-info}/METADATA +1 -1
  127. {pyegeria-5.4.0.22.dist-info → pyegeria-5.4.0.24.dist-info}/RECORD +130 -30
  128. {pyegeria-5.4.0.22.dist-info → pyegeria-5.4.0.24.dist-info}/LICENSE +0 -0
  129. {pyegeria-5.4.0.22.dist-info → pyegeria-5.4.0.24.dist-info}/WHEEL +0 -0
  130. {pyegeria-5.4.0.22.dist-info → pyegeria-5.4.0.24.dist-info}/entry_points.txt +0 -0
File without changes
@@ -6,6 +6,7 @@ import sys
6
6
  from datetime import datetime
7
7
 
8
8
  from loguru import logger
9
+ from pydantic import ValidationError
9
10
 
10
11
  log_format = "{time} | {level} | {function} | {line} | {message} | {extra}"
11
12
  logger.remove()
@@ -31,7 +32,8 @@ from md_processing import (extract_command, process_glossary_upsert_command, pro
31
32
  process_collection_list_command, process_collection_upsert_command, process_link_agreement_item_command,
32
33
  process_gov_definition_upsert_command, GOV_COM_LIST, GOV_LINK_LIST,
33
34
  process_gov_def_link_detach_command, process_gov_definition_list_command,
34
- process_gov_def_context_command, COLLECTIONS_LIST, SIMPLE_COLLECTIONS)
35
+ process_gov_def_context_command, process_supporting_gov_def_link_detach_command,
36
+ COLLECTIONS_LIST, SIMPLE_COLLECTIONS, GOV_LINK_LIST,)
35
37
  from md_processing.md_commands.data_designer_commands import (process_data_spec_upsert_command,
36
38
  process_data_dict_upsert_command,
37
39
  process_data_collection_list_command,
@@ -41,7 +43,8 @@ from md_processing.md_commands.data_designer_commands import (process_data_spec_
41
43
  process_data_field_upsert_command,
42
44
  process_data_structure_upsert_command,
43
45
  process_data_class_upsert_command)
44
- from pyegeria import EgeriaTech
46
+
47
+ from pyegeria import EgeriaTech, PyegeriaException, print_basic_exception, print_validation_error
45
48
 
46
49
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
47
50
  EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
@@ -112,7 +115,7 @@ def process_markdown_file(input_file: str, output_folder:str, directive: str, se
112
115
  return # No block to process
113
116
 
114
117
  potential_command = extract_command(current_block) # Extract object_action
115
- if potential_command in cmd_list:
118
+ if (potential_command in cmd_list):
116
119
  # Process the block based on the object_action
117
120
  if potential_command == "Provenance":
118
121
  result = process_provenance_command(input_file, current_block)
@@ -198,6 +201,12 @@ def process_markdown_file(input_file: str, output_folder:str, directive: str, se
198
201
  elif potential_command in ['View Governance Definitions', 'List Governance Definitions',
199
202
  'View Gov Definitions', 'List Gov Definitions']:
200
203
  result = process_gov_definition_list_command(client, current_block, directive)
204
+ elif potential_command in GOV_LINK_LIST:
205
+ result = process_gov_def_link_detach_command(client, current_block, directive)
206
+ elif potential_command in ['Link Governance Mechanism', 'Detach Governance Mechanism',
207
+ 'Link Governance Response', 'Detach Governance Response',]:
208
+ result = process_supporting_gov_def_link_detach_command(client, current_block, directive)
209
+
201
210
  elif potential_command in COLLECTIONS_LIST:
202
211
  result = process_collection_list_command(client, current_block, directive)
203
212
 
@@ -283,6 +292,10 @@ def process_markdown_file(input_file: str, output_folder:str, directive: str, se
283
292
  click.echo("\nNo updates detected. New File not created.")
284
293
  logger.error("===> Unknown Command? <===")
285
294
 
295
+ except PyegeriaException as e:
296
+ print_basic_exception(e)
297
+ except ValidationError as e:
298
+ print_validation_error(e)
286
299
  except (Exception):
287
300
  console.print_exception(show_locals=True)
288
301
 
@@ -10,6 +10,7 @@ import json
10
10
  import os
11
11
  import time
12
12
 
13
+ from jsonschema import ValidationError
13
14
  from rich import box
14
15
  from rich.console import Console
15
16
  from rich.markdown import Markdown
@@ -21,6 +22,8 @@ from pyegeria import (
21
22
  CollectionManager,
22
23
  NO_ELEMENTS_FOUND, config_logging, load_app_config, get_app_config, init_logging, config_logging, PyegeriaException,
23
24
  print_basic_exception,PyegeriaException, )
25
+ from pyegeria._exceptions_new import print_validation_error
26
+
24
27
  # from pyegeria._exceptions_new import PyegeriaException, print_exception_response
25
28
 
26
29
  EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
@@ -135,7 +138,7 @@ def display_collections(
135
138
  table.add_column("Members")
136
139
 
137
140
  collections = m_client.find_collections(
138
- search_string.strip(), None, True, False, ignore_case=True,
141
+ search_string.strip(), None, ["Collection"],True, False, ignore_case=True,
139
142
  output_format = "DICT", output_format_set=out_struct
140
143
  )
141
144
  if type(collections) is list:
@@ -153,7 +156,7 @@ def display_collections(
153
156
  collection_type = collection.get("collectionType", "---")
154
157
  classifications = collection.get("classifications", "---")
155
158
 
156
- classifications_md = Markdown(classifications)
159
+ classifications_md = Markdown(classifications) if classifications else ""
157
160
  members_struct = m_client.get_member_list(collection_guid=guid)
158
161
  member_list = ""
159
162
  if isinstance(members_struct, list):
@@ -161,7 +164,7 @@ def display_collections(
161
164
  member_list = member_list + f"- {member.get('qualifiedName','---')}\n"
162
165
 
163
166
  # members = "\n* ".join(collection.get("members", []))
164
- members_md = Markdown(member_list)
167
+ members_md = Markdown(member_list) if member_list else ""
165
168
 
166
169
  table.add_row(
167
170
  display_name,
@@ -180,10 +183,12 @@ def display_collections(
180
183
  else:
181
184
  print("==> No collections with that name found")
182
185
 
183
- except (
184
- PyegeriaException
185
- ) as e:
186
+ except (PyegeriaException) as e:
186
187
  print_basic_exception(e)
188
+ except ValidationError as e:
189
+ print_validation_error(e)
190
+ except Exception as e:
191
+ print(f"An unexpected error occurred: {e}")
187
192
  finally:
188
193
  m_client.close_session()
189
194
 
@@ -217,6 +222,10 @@ def main():
217
222
 
218
223
  except PyegeriaException as e:
219
224
  print_basic_exception(e)
225
+ except ValidationError as e:
226
+ print_validation_error(e)
227
+ except Exception as e:
228
+ print(f"An unexpected error occurred: {e}")
220
229
 
221
230
 
222
231
  if __name__ == "__main__":
@@ -50,16 +50,15 @@ import pydevd_pycharm
50
50
 
51
51
  from pyegeria import (
52
52
  EgeriaTech,
53
- NO_ELEMENTS_FOUND,
53
+ CollectionManager,
54
+ NO_ELEMENTS_FOUND, GovernanceOfficer,
54
55
  # config_logging,
55
56
  # get_app_config
56
- )
57
+ )
57
58
  from pyegeria.load_config import get_app_config
58
59
  from pyegeria.logging_configuration import config_logging
59
- from pyegeria._output_formats import select_output_format_set, get_output_format_set_heading, \
60
- get_output_format_set_description
60
+ from pyegeria._output_formats import (select_output_format_set, get_output_format_set_heading, get_output_format_set_description)
61
61
  from pyegeria._exceptions_new import PyegeriaException, print_exception_response
62
- from pyegeria.egeria_tech_client import EgeriaTech
63
62
 
64
63
  # pydevd_pycharm.settrace('host.docker.internal', # Use 'host.docker.internal' to connect to the host machine
65
64
  # port=5678, # Port to communicate with PyCharm
@@ -130,8 +129,8 @@ def execute_format_set_action(
130
129
  print(f"Error: Output format set '{format_set_name}' does not have an action property.")
131
130
  return
132
131
 
133
- # Extract the function and parameters from the action property
134
- action = format_set["action"][0] # Assuming there's only one action
132
+ # Extract the function and parameters from the action property (now a dict)
133
+ action = format_set["action"]
135
134
  func = action.get("function")
136
135
  user_params = action.get("user_params", [])
137
136
  spec_params = action.get("spec_params", {})
@@ -141,6 +140,7 @@ def execute_format_set_action(
141
140
  for param in user_params:
142
141
  if param in kwargs and kwargs[param]:
143
142
  params[param] = kwargs[param]
143
+ # print(f"Found value '{kwargs[param]}' for parameter '{param}'.")
144
144
  elif param not in kwargs and param not in spec_params:
145
145
  print(f"Warning: Required parameter '{param}' not provided for format set '{format_set_name}'.")
146
146
 
@@ -157,10 +157,14 @@ def execute_format_set_action(
157
157
  # If function name is provided as a string, parse it to get class and method
158
158
  if isinstance(func, str) and "." in func:
159
159
  class_name, method_name = func.split(".")
160
- # if class_name == "CollectionManager":
161
- # client_class = CollectionManager
162
- # elif class_name == "EgeriaTech":
163
- client_class = EgeriaTech
160
+ if class_name == "CollectionManager":
161
+ client_class = CollectionManager
162
+ elif class_name == "GovernanceOfficer":
163
+ client_class = GovernanceOfficer
164
+ else:
165
+ client_class = EgeriaTech
166
+
167
+
164
168
  # Add more client classes as needed
165
169
 
166
170
  # # If client_class is still None, determine based on format set name
@@ -217,6 +221,7 @@ def execute_format_set_action(
217
221
  params['output_format'] = output_format
218
222
 
219
223
  # Call the function with the parameters
224
+ print(f"\n==> Calling function: {func} with parameters:{params}")
220
225
  try:
221
226
  if isinstance(func, type(client.find_collections)): # It's a method of the client
222
227
  # Call the function as an instance method of the client
@@ -246,88 +251,88 @@ def execute_format_set_action(
246
251
  if output_format == "HTML":
247
252
  print(f"\n==> Web link: [{file_name}]({app_config.pyegeria_publishing_root}/{file_name}")
248
253
  return
254
+ else:
255
+ # For TABLE output, add output_format to params
256
+ params['output_format'] = "DICT"
257
+ print(f"\n==> Calling function: {func} with parameters:{params}")
258
+ # Call the function and create a table
259
+ try:
260
+ if hasattr(client, method_name): # It's a method of the client
261
+ # Call the function as an instance method of the client
262
+ result = func(**params)
263
+ else:
264
+ # For standalone functions, call with client as first argument
265
+ result = func(client, **params)
266
+ except TypeError as e:
267
+ # Handle parameter mismatch errors
268
+ print(f"Error calling function: {e}")
269
+ print(f"Parameters provided: {params}")
270
+ return
249
271
 
250
- # For TABLE output, add output_format to params
251
- params['output_format'] = "DICT"
252
-
253
- # Call the function and create a table
254
- try:
255
- if isinstance(func, type(client.find_collections)): # It's a method of the client
256
- # Call the function as an instance method of the client
257
- result = func(**params)
258
- else:
259
- # For standalone functions, call with client as first argument
260
- result = func(client, **params)
261
- except TypeError as e:
262
- # Handle parameter mismatch errors
263
- print(f"Error calling function: {e}")
264
- print(f"Parameters provided: {params}")
265
- return
266
-
267
- if not result or result == NO_ELEMENTS_FOUND:
268
- print(f"\n==> No elements found for format set '{format_set_name}'")
269
- return
270
-
271
-
272
- if heading and desc:
273
- console.print(Markdown(preamble))
274
-
275
- # Create a table for the results
276
- table = Table(
277
- title=f"{format_set_name} @ {time.asctime()}",
278
- style="bright_white on black",
279
- header_style="bright_white on dark_blue",
280
- title_style="bold white on black",
281
- caption_style="white on black",
282
- show_lines=True,
283
- box=box.ROUNDED,
284
- caption=f"View Server '{view_server}' @ Platform - {view_url}",
285
- expand=True,
286
- )
287
-
288
- # Handle both list and dictionary results
289
- if isinstance(result, list):
290
- if not result:
272
+ if not result or result == NO_ELEMENTS_FOUND:
291
273
  print(f"\n==> No elements found for format set '{format_set_name}'")
292
274
  return
293
-
294
- # Sort the results by display_name if available
295
- if "display_name" in result[0]:
296
- sorted_results = sorted(result, key=lambda k: k.get("display_name", ""))
297
- elif "Display Name" in result[0]:
298
- sorted_results = sorted(result, key=lambda k: k.get("Display Name", ""))
275
+
276
+
277
+ if heading and desc:
278
+ console.print(Markdown(preamble))
279
+
280
+ # Create a table for the results
281
+ table = Table(
282
+ title=f"{format_set_name} @ {time.asctime()}",
283
+ style="bright_white on black",
284
+ header_style="bright_white on dark_blue",
285
+ title_style="bold white on black",
286
+ caption_style="white on black",
287
+ show_lines=True,
288
+ box=box.ROUNDED,
289
+ caption=f"View Server '{view_server}' @ Platform - {view_url}",
290
+ expand=True,
291
+ )
292
+
293
+ # Handle both list and dictionary results
294
+ if isinstance(result, list):
295
+ if not result:
296
+ print(f"\n==> No elements found for format set '{format_set_name}'")
297
+ return
298
+
299
+ # Sort the results by display_name if available
300
+ if "display_name" in result[0]:
301
+ sorted_results = sorted(result, key=lambda k: k.get("display_name", ""))
302
+ elif "Display Name" in result[0]:
303
+ sorted_results = sorted(result, key=lambda k: k.get("Display Name", ""))
304
+ else:
305
+ sorted_results = result
306
+
307
+ # Add columns dynamically based on the first result
308
+ column_headings = list(sorted_results[0].keys())
309
+ for heading in column_headings:
310
+ table.add_column(heading, justify="left", style="cyan")
311
+
312
+ # Add rows
313
+ for item in sorted_results:
314
+ row_values = []
315
+ for key in column_headings:
316
+ value = item.get(key, "")
317
+ row_values.append(str(value))
318
+
319
+ table.add_row(*row_values)
299
320
  else:
300
- sorted_results = result
301
-
302
- # Add columns dynamically based on the first result
303
- column_headings = list(sorted_results[0].keys())
304
- for heading in column_headings:
305
- table.add_column(heading, justify="left", style="cyan")
306
-
307
- # Add rows
308
- for item in sorted_results:
321
+ # Handle single dictionary result
322
+ column_headings = list(result.keys())
323
+ for heading in column_headings:
324
+ table.add_column(heading, justify="left", style="cyan")
325
+
309
326
  row_values = []
310
327
  for key in column_headings:
311
- value = item.get(key, "")
328
+ value = result.get(key, "")
312
329
  row_values.append(str(value))
313
-
330
+
314
331
  table.add_row(*row_values)
315
- else:
316
- # Handle single dictionary result
317
- column_headings = list(result.keys())
318
- for heading in column_headings:
319
- table.add_column(heading, justify="left", style="cyan")
320
-
321
- row_values = []
322
- for key in column_headings:
323
- value = result.get(key, "")
324
- row_values.append(str(value))
325
-
326
- table.add_row(*row_values)
327
-
328
- # Print the table
329
332
 
330
- console.print(table)
333
+ # Print the table
334
+
335
+ console.print(table)
331
336
 
332
337
  except PyegeriaException as e:
333
338
  print_exception_response(e)
@@ -370,7 +375,7 @@ def main():
370
375
  # Add arguments based on the format set's user_params
371
376
  user_params = []
372
377
  if "action" in format_set:
373
- action = format_set["action"][0] # Assuming there's only one action
378
+ action = format_set["action"]
374
379
  user_params = action.get("user_params", [])
375
380
 
376
381
  for param in user_params:
File without changes
File without changes
Binary file
md_processing/__init__.py CHANGED
@@ -3,8 +3,10 @@ This package contains functions to parse and process Egeria Markdown (Freddie)
3
3
  """
4
4
  from md_processing.md_commands.governance_officer_commands import (process_gov_definition_upsert_command,
5
5
  process_gov_def_link_detach_command,
6
+ process_supporting_gov_def_link_detach_command,
6
7
  process_gov_definition_list_command,
7
- process_gov_def_context_command)
8
+ process_gov_def_context_command,
9
+ )
8
10
 
9
11
 
10
12
  from md_processing.md_commands.product_manager_commands import (process_digital_product_upsert_command,
@@ -45,11 +47,11 @@ from md_processing.md_processing_utils.common_md_utils import (render_markdown,
45
47
  console, debug_level, get_element_dictionary,
46
48
  update_element_dictionary, clear_element_dictionary,
47
49
  is_present, find_key_with_value,
48
- process_provenance_command, set_metadata_source_request_body,
50
+ process_provenance_command, set_delete_request_body,
49
51
  set_rel_request_body, set_filter_request_body,
50
52
  set_update_body, set_peer_gov_def_request_body,
51
53
  set_gov_prop_body, set_prop_body, set_create_body,
52
-
54
+ GOVERNANCE_POLICIES, GOVERNANCE_CONTROLS, GOVERNANCE_DRIVERS
53
55
  )
54
56
  from md_processing.md_processing_utils.extraction_utils import (extract_command_plus, extract_command,
55
57
  extract_attribute, process_simple_attribute,