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
@@ -4,10 +4,11 @@ This file contains general utility functions for processing Egeria Markdown
4
4
  import json
5
5
  import os
6
6
  import sys
7
- from typing import List
7
+ from typing import List, Optional
8
8
 
9
9
  from loguru import logger
10
10
  from rich import print
11
+ from rich.markdown import Markdown
11
12
  from rich.console import Console
12
13
 
13
14
  from md_processing.md_processing_utils.common_md_utils import (get_current_datetime_string, get_element_dictionary,
@@ -15,16 +16,20 @@ from md_processing.md_processing_utils.common_md_utils import (get_current_datet
15
16
  split_tb_string, str_to_bool, )
16
17
  from md_processing.md_processing_utils.extraction_utils import (process_simple_attribute, extract_attribute,
17
18
  get_element_by_name)
19
+ from md_processing.md_processing_utils.common_md_utils import (update_element_dictionary, set_gov_prop_body, \
20
+ set_update_body, set_create_body,
21
+ set_peer_gov_def_request_body, set_rel_request_body,
22
+ set_delete_request_body,set_rel_request_body,
23
+ set_filter_request_body, setup_log,
24
+ ALL_GOVERNANCE_DEFINITIONS, set_find_body)
25
+ from md_processing.md_processing_utils.extraction_utils import (extract_command_plus, update_a_command)
18
26
  from md_processing.md_processing_utils.md_processing_constants import (get_command_spec)
19
27
  from md_processing.md_processing_utils.message_constants import (ERROR, INFO, WARNING, ALWAYS, EXISTS_REQUIRED)
20
- from pyegeria import EgeriaTech
28
+ from pyegeria import EgeriaTech, select_output_format_set
29
+
21
30
  from pyegeria._globals import DEBUG_LEVEL
22
31
 
23
- log_format = "P {time} | {level} | {function} | {line} | {message} | {extra}"
24
- logger.remove()
25
- logger.add(sys.stderr, level="INFO", format=log_format, colorize=True)
26
- logger.add("debug_log.log", rotation="1 day", retention="1 week", compression="zip", level="TRACE", format=log_format,
27
- colorize=True)
32
+
28
33
  # Constants
29
34
  EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
30
35
  EGERIA_USAGE_LEVEL = os.environ.get("EGERIA_USAGE_LEVEL", "Basic")
@@ -923,3 +928,101 @@ def update_term_categories(egeria_client: EgeriaTech, term_guid: str, categories
923
928
 
924
929
 
925
930
 
931
+
932
+ @logger.catch
933
+ def process_output_command(egeria_client: EgeriaTech, txt: str, directive: str = "display") -> Optional[str]:
934
+ """
935
+ Processes a generic output request by extracting attributes (including Output Format and
936
+ Output Format Set) and dynamically invoking the find function specified by the
937
+ output_format_set, following the approach used in commands/cat/list_format_set.
938
+
939
+ This is modeled on process_gov_definition_list_command but uses the dynamic
940
+ dispatch via the output format set rather than directly calling a specific
941
+ egeria_client method.
942
+
943
+ :param egeria_client: EgeriaTech composite client instance
944
+ :param txt: The command text (e.g., parsed from a markdown cell)
945
+ :param directive: display | validate | process
946
+ :return: Markdown string for processed output or None
947
+ """
948
+ command, object_type, object_action = extract_command_plus(txt)
949
+ print(Markdown(f"# {command}\n"))
950
+
951
+ parsed_output = parse_view_command(egeria_client, object_type, object_action, txt, directive)
952
+
953
+ valid = parsed_output['valid']
954
+ print(Markdown(f"Performing {command}"))
955
+ print(Markdown(parsed_output['display']))
956
+
957
+ attr = parsed_output.get('attributes', {})
958
+
959
+ search_string = attr.get('Search String', {}).get('value', '*')
960
+ output_format = attr.get('Output Format', {}).get('value', 'LIST')
961
+ output_format_set = attr.get('Output Format Set', {}).get('value', object_type)
962
+
963
+ if directive == "display":
964
+ return None
965
+ elif directive == "validate":
966
+ # Validate that the format set exists and has an action
967
+ fmt = select_output_format_set(output_format_set, "ANY") if valid else None
968
+ if valid and fmt and fmt.get("action"):
969
+ print(Markdown(f"==> Validation of {command} completed successfully!\n"))
970
+ return True
971
+ else:
972
+ msg = f"Validation failed for object_action `{command}`"
973
+ logger.error(msg)
974
+ return False
975
+
976
+ elif directive == "process":
977
+ try:
978
+ if not valid:
979
+ msg = f"Validation failed for {object_action} `{object_type}`"
980
+ logger.error(msg)
981
+ return None
982
+
983
+ # Resolve the find function from the output format set
984
+ fmt = select_output_format_set(output_format_set, output_format)
985
+ if not fmt:
986
+ logger.error(f"Output format set '{output_format_set}' not found or not compatible with '{output_format}'.")
987
+ return None
988
+ action = fmt.get("action", {})
989
+ func_spec = action.get("function")
990
+ if not func_spec or "." not in func_spec:
991
+ func_spec = f"EgeriaTech.find_{object_type.replace(' ', '_').lower()}"
992
+
993
+
994
+ # Extract method name and get it from the composite client
995
+ _, method_name = func_spec.split(".", 1)
996
+ if not hasattr(egeria_client, method_name):
997
+ logger.error(f"Method '{method_name}' not available on EgeriaTech client.")
998
+ return None
999
+ method = getattr(egeria_client, method_name)
1000
+
1001
+ # Build body and params
1002
+ list_md = f"\n# `{object_type}` with filter: `{search_string}`\n\n"
1003
+ body = set_find_body(object_type, attr)
1004
+
1005
+ params = {
1006
+ 'search_string': search_string,
1007
+ 'body': body,
1008
+ 'output_format': output_format,
1009
+ 'output_format_set': output_format_set,
1010
+ }
1011
+
1012
+ # Call the resolved method
1013
+ struct = method(**params)
1014
+
1015
+ if output_format.upper() == "DICT":
1016
+ list_md += f"```\n{json.dumps(struct, indent=4)}\n```\n"
1017
+ else:
1018
+ list_md += struct
1019
+ logger.info(f"Wrote `{object_type}` for search string: `{search_string}` using format set '{output_format_set}'")
1020
+
1021
+ return list_md
1022
+
1023
+ except Exception as e:
1024
+ logger.error(f"Error performing {command}: {e}")
1025
+ console.print_exception(show_locals=True)
1026
+ return None
1027
+ else:
1028
+ return None
@@ -11,7 +11,7 @@ from loguru import logger
11
11
  from rich import print
12
12
  from rich.console import Console
13
13
  from rich.markdown import Markdown
14
- from pyegeria.utils import (camel_to_title_case)
14
+ from pyegeria.utils import (camel_to_title_case, body_slimmer)
15
15
  from pyegeria._globals import DEBUG_LEVEL
16
16
  from md_processing.md_processing_utils.message_constants import message_types
17
17
 
@@ -38,11 +38,22 @@ LOG_FORMAT = "D <green> {time} </green> | {level} | {function} | {line} | {messa
38
38
  CONSOLE_LOG_FORMAT = "<green>{time}</green> | {message}"
39
39
 
40
40
  console = Console(width=EGERIA_WIDTH)
41
- GENERAL_GOVERNANCE_DEFINITIONS = ["Business Imperative", "Regulation Article", "Threat", "Governance Principle",
42
- "Governance Obligation", "Governance Approach", "Governance Processing Purpose"]
41
+ GENERAL_GOVERNANCE_DEFINITIONS = ["Governance Definition", "Business Imperative", "Regulation Article", "Threat",
42
+ "Governance Policy", "Governance Principle", "Governance Obligation",
43
+ "Governance Approach",
44
+ "Governance Processing Purpose"]
45
+ GOVERNANCE_DRIVERS = ["Governance Driver", "Governance Strategy", "Governance Imperative", "Regulation",
46
+ "Regulation Article", "Threat"]
47
+ GOVERNANCE_POLICIES = ["Governance Policy", "Governance Principle", "Governance Obligation", "Governance Approach"]
43
48
 
44
- GOVERNANCE_CONTROLS = ["Governance Rule", "Service Level Objective", "Governance Process",
45
- "Governance Responsibility", "Governance Procedure", "Security Access Control"]
49
+
50
+ GOVERNANCE_CONTROLS = ["Governance Control", "Governance Rule", "Service Level Objective", "Governance Action",
51
+ "Security Access Control", "Governance Procedure","Governance Responsibility",
52
+ "Subject Area Definition", "Data Processing Purposes", "Methodology"]
53
+
54
+ ALL_GOVERNANCE_DEFINITIONS = GENERAL_GOVERNANCE_DEFINITIONS + GOVERNANCE_CONTROLS + ["Governance Strategy", "Regulation",
55
+ "Security Group", "GovernanceMetric",
56
+ "Naming Standard Rule", "TermsAndConditions", "Certification Type", "License Type"]
46
57
 
47
58
  debug_level = DEBUG_LEVEL
48
59
  global COMMAND_DEFINITIONS
@@ -216,13 +227,46 @@ def find_key_with_value(value: str) -> str | None:
216
227
  return None # If value not found
217
228
 
218
229
 
230
+ def set_find_body(object_type: str, attributes: dict)->dict:
231
+ prop_name = object_type.replace(" ", "")
232
+
233
+ start = attributes.get('Start From', {}).get('value', 0)
234
+ start_from = int(start) if start else 0
235
+ page = attributes.get('Page Size', {}).get('value', 0)
236
+ page_size = int(page) if page else 0
237
+ depth = attributes.get('Graph Query Depth', {}).get('value', 0)
238
+ depth = int(depth) if depth else 0
239
+
240
+
241
+
242
+ body = {
243
+ "class": "SearchStringRequestBody",
244
+ "searchString": attributes.get('Search String', {}).get('value', None),
245
+ "startsWith": attributes.get('Start With', {}).get('value', True),
246
+ "endWith": attributes.get('End With', {}).get('value', False),
247
+ "ignoreCase": attributes.get('Ignore Case', {}).get('value', False),
248
+ "limitResultsByStatus": attributes.get('Limit Results By Status', {}).get('value', False),
249
+ "startFrom": int(attributes.get('Start From', {}).get('value', 0)),
250
+ "pageSize": int(attributes.get('Page Size', {}).get('value', 0)),
251
+ # "metadataElementSubtypeNames": attributes.get('Metadata Element Subtype Name', {}).get('value', None),
252
+ "metadataElementTypeName": attributes.get('Metadata Element Type Name', {}).get('value', None),
253
+ "effectiveTime": attributes.get('Effective Time', {}).get('value', None),
254
+ "governanceZoneFilter" : attributes.get('Governance Zone Filter', {}).get('value', None),
255
+ "graphQueryDepth": int(attributes.get('Graph Query Depth', {}).get('value', 0)),
256
+ "initialStatus": attributes.get('Status', {}).get('value', "ACTIVE"),
257
+ "initialClassifications": {}}
258
+
259
+ return body
260
+
261
+
219
262
  def set_create_body(object_type: str, attributes: dict)->dict:
220
263
  prop_name = object_type.replace(" ", "")
221
264
  body = {
222
- "class": "NewGovernanceDefinitionRequestBody",
265
+ "class": "NewElementRequestBody",
223
266
  "externalSourceGUID": attributes.get('External Source GUID', {}).get('guid', None),
224
267
  "externalSourceName": attributes.get('External Source Name', {}).get('value', None),
225
268
  "effectiveTime": attributes.get('Effective Time', {}).get('value', None),
269
+ "governanceZoneFilter" : attributes.get('Governance Zone Filter', {}).get('value', None),
226
270
  "forLineage": attributes.get('For Lineage', {}).get('value', False),
227
271
  "forDuplicateProcessing": attributes.get('For Duplicate Processing', {}).get('value', False),
228
272
  "anchorGUID": attributes.get('Anchor ID', {}).get('guid', None),
@@ -245,6 +289,7 @@ def set_update_body(object_type: str, attributes: dict)->dict:
245
289
  "class" : "UpdateElementRequestBody",
246
290
  "externalSourceGUID": attributes.get('External Source GUID', {}).get('guid', None),
247
291
  "externalSourceName": attributes.get('External Source Name', {}).get('value', None),
292
+ "governanceZoneFilter": attributes.get('Governance Zone Filter', {}).get('value', None),
248
293
  "effectiveTime": attributes.get('Effective Time', {}).get('value', None),
249
294
  "forLineage": attributes.get('For Lineage', {}).get('value', False),
250
295
  "forDuplicateProcessing": attributes.get('For Duplicate Processing', {}).get('value', False),
@@ -261,7 +306,7 @@ def set_prop_body(object_type: str, qualified_name: str, attributes: dict)->dict
261
306
  "displayName": attributes['Display Name'].get('value', None),
262
307
  "qualifiedName" : qualified_name,
263
308
  "description": attributes['Description'].get('value', None),
264
- "status": attributes.get('Status', {}).get('value', "ACTIVE"),
309
+ "category": attributes.get('Category', {}).get('value', None),
265
310
  "userDefinedStatus": attributes.get('User Defined Status', {}).get('value', None),
266
311
  "versionIdentifier": attributes.get('Version Identifier', {}).get('value', None),
267
312
  "effectiveFrom": attributes.get('Effective From', {}).get('value', None),
@@ -270,26 +315,51 @@ def set_prop_body(object_type: str, qualified_name: str, attributes: dict)->dict
270
315
  "extendedProperties": attributes.get('Extended Properties', {}).get('value', None)
271
316
  }
272
317
 
318
+ def set_product_body(object_type: str, qualified_name: str, attributes: dict)->dict:
319
+ prop_bod = set_prop_body(object_type, qualified_name, attributes)
320
+ prop_bod["identifier"] = attributes.get('Identifier', {}).get('value', None)
321
+ prop_bod["productName"] = attributes.get('Product Name', {}).get('value', None)
322
+ prop_bod["maturity"] = attributes.get('Maturity', {}).get('value', None)
323
+ prop_bod["serviceLife"] = attributes.get('Service Life', {}).get('value', None)
324
+ prop_bod["introductionDate"] = attributes.get('Introduction Date', {}).get('value', [])
325
+ prop_bod["withdrawalDate"] = attributes.get('Withdrawal Date', {}).get('value', [])
326
+ prop_bod["nextVersion"] = attributes.get('Next Version Date', {}).get('value', [])
327
+
328
+ def set_update_status_body(object_type: str, attributes: dict)->dict:
329
+ return {
330
+ "class" : "UpdateStatusRequestBody",
331
+ "effectiveTime": attributes.get('Effective Time', {}).get('value', None),
332
+ "forLineage": attributes.get('For Lineage', {}).get('value', False),
333
+ "forDuplicateProcessing": attributes.get('For Duplicate Processing', {}).get('value', False),
334
+ "mergeUpdate": attributes.get('Merge Update', {}).get('value', True),
335
+ }
336
+
273
337
  def set_gov_prop_body(object_type: str, qualified_name: str, attributes: dict)->dict:
274
338
  prop_name = object_type.replace(" ", "")
275
339
  prop_bod = set_prop_body(object_type, qualified_name, attributes)
276
340
  prop_bod["domainIdentifier"] = attributes.get('Domain Identifier', {}).get('value', None)
277
- # prop_bod["documentIdentifier"] = attributes.get('Document Identifier', {}).get('value', None)
278
- prop_bod["title"]= attributes.get('Display Name', {}).get('value', None)
279
- prop_bod['documentIdentifier'] = qualified_name
341
+ prop_bod["displayName"]= attributes.get('Display Name', {}).get('value', None)
342
+ prop_bod['qualifiedName'] = qualified_name
280
343
  prop_bod["versionIdentifier"] = attributes.get('Version Identifier', {}).get('value', None)
281
344
  prop_bod["summary"] = attributes.get('Summary', {}).get('value', None)
345
+ prop_bod["description"] = attributes.get('Description', {}).get('value', None)
346
+
282
347
  prop_bod["scope"] = attributes.get('Scope', {}).get('value', None)
283
348
  prop_bod["importance"] = attributes.get('Importance', {}).get('value', None)
284
349
  prop_bod["implications"] = attributes.get('Implication', {}).get('value', [])
285
350
  prop_bod["outcomes"] = attributes.get('Outcomes', {}).get('value', [])
286
351
  prop_bod["results"] = attributes.get('Results', {}).get('value', [])
352
+ prop_bod["effectiveFrom"] = attributes.get('Effective From', {}).get('value', None),
353
+ prop_bod["effectiveTo"] = attributes.get('Effective To', {}).get('value', None),
354
+ prop_bod["additionalProperties"] = attributes.get('Additional Properties', {}).get('value', None),
355
+ prop_bod["extendedProperties"] = attributes.get('Extended Properties', {}).get('value', None)
287
356
 
288
- body = update_body_for_type(object_type, prop_bod, attributes)
357
+
358
+ body = update_gov_body_for_type(object_type, prop_bod, attributes)
289
359
  return body
290
360
 
291
361
 
292
- def update_body_for_type(object_type: str, body: dict, attributes: dict) -> dict:
362
+ def update_gov_body_for_type(object_type: str, body: dict, attributes: dict) -> dict:
293
363
  gov_def_name = object_type.replace(" ", "")
294
364
  if object_type in GENERAL_GOVERNANCE_DEFINITIONS:
295
365
  return body
@@ -298,7 +368,7 @@ def update_body_for_type(object_type: str, body: dict, attributes: dict) -> dict
298
368
  return body
299
369
 
300
370
  elif object_type == "Regulation":
301
- body['source'] = attributes.get('Source', {}).get('value', None)
371
+ body['regulationSource'] = attributes.get('Regulation Source', {}).get('value', None)
302
372
  body['regulators'] = attributes.get('Regulators', {}).get('value', [])
303
373
  return body
304
374
 
@@ -308,17 +378,24 @@ def update_body_for_type(object_type: str, body: dict, attributes: dict) -> dict
308
378
  elif object_type == "Security Group":
309
379
  body['distinguishedName'] = attributes.get('Distinguished Name', {}).get('value', None)
310
380
  return body
381
+ elif object_type == "GovernanceMetric":
382
+ body['measurement'] = attributes.get('Measurement', {}).get('value', None)
383
+ body['target'] = attributes.get('Target', {}).get('value', None)
384
+ return body
311
385
  elif object_type == "Naming Standard Rule":
312
386
  body['namePatterns'] = attributes.get('Name Patterns', {}).get('value', [])
313
387
  return body
314
- elif object_type in ["Certification Type", "License Type"]:
315
- body['details'] = attributes.get('Details', {}).get('value', None)
388
+ elif object_type in ["TermsAndConditions", "Certification Type", "License Type"]:
389
+ body['entitlements'] = attributes.get('Entitlementss', {}).get('value', {})
390
+ body['restrictions'] = attributes.get('Restrictions', {}).get('value', {})
391
+ body['obligations'] = attributes.get('Obligations', {}).get('value', {})
392
+
316
393
  return body
317
394
 
318
395
 
319
396
  def set_rel_request_body(object_type: str, attributes: dict)->dict:
320
397
  return {
321
- "class" : "RelationshipRequestBody",
398
+ "class" : "NewRelationshipRequestBody",
322
399
  "externalSourceGUID": attributes.get('External Source GUID', {}).get('guid', None),
323
400
  "externalSourceName": attributes.get('External Source Name', {}).get('value', None),
324
401
  "effectiveTime": attributes.get('Effective Time', {}).get('value', None),
@@ -338,9 +415,9 @@ def set_peer_gov_def_request_body(object_type: str, attributes: dict)->dict:
338
415
  }
339
416
  return rel_body
340
417
 
341
- def set_metadata_source_request_body(object_type: str, attributes: dict)->dict:
418
+ def set_delete_request_body(object_type: str, attributes: dict)->dict:
342
419
  return {
343
- "class": "MetadataSourceRequestBody",
420
+ "class": "DeleteRequestBody",
344
421
  "externalSourceGUID": attributes.get('External Source GUID', {}).get('guid', None),
345
422
  "externalSourceName": attributes.get('External Source Name', {}).get('value', None),
346
423
  "effectiveTime": attributes.get('Effective Time', {}).get('value', None),
@@ -371,14 +448,23 @@ def set_element_status_request_body(object_type: str, attributes: dict)->dict:
371
448
  "forLineage": attributes.get('For Lineage', {}).get('value', False),
372
449
  "forDuplicateProcessing": attributes.get('For Duplicate Processing', {}).get('value', False)
373
450
  }
374
- def set_collection_property_body(object_type: str, qualified_name:str, attributes: dict)->dict:
375
- body = set_prop_body("Collection", qualified_name,attributes)
376
- body["category"] = attributes.get('Category', {}).get('value', None)
451
+
452
+
453
+ def set_classifications(object_type: str, attributes: dict)->dict:
454
+ classifications = attributes.get('Classifications', {}).get('name_list', None)
455
+ body = None
456
+ if classifications:
457
+ body = {classification: {} for classification in classifications} if cclassifications else {}
377
458
  return body
378
459
 
379
460
  def set_collection_classifications(object_type: str, attributes: dict)->dict:
380
- collection_classifications = attributes.get('Collection Classifications', {}).get('name_list', None)
381
- if collection_classifications is None:
382
- collection_classifications = object_type
383
- body = {classification: {} for classification in collection_classifications} if collection_classifications else {}
384
- return body
461
+ classifications = attributes.get('Classifications', {}).get('name_list', None)
462
+
463
+ if object_type in ["Folder", "Root"]:
464
+ if object_type not in classifications:
465
+ classifications.append(object_type)
466
+
467
+ body = None
468
+ if classifications:
469
+ body = {classification: {} for classification in classifications} if cclassifications else {}
470
+ return body
File without changes
@@ -51,9 +51,10 @@ TERM_RELATIONSHPS = ["Synonym", "Translation", "PreferredTerm", "TermISATYPEOFRe
51
51
  "ISARelationship"]
52
52
 
53
53
  # List of supported md_commands
54
- GOV_LINK_LIST = [ "Link Governance Drivers", "Detach Governance Drivers",
55
- "Link Governance Policies", "Detach Governance Policies",
56
- "Link Governance Controls", "Detach Governance Controls",]
54
+ GOV_LINK_LIST = [ "Link Governance Drivers", "Link Drivers", "Detach Governance Drivers", "Detach Drivers",
55
+ "Link Governance Policies", "Link Policies", "Detach Governance Policies", "Detach Policies",
56
+ "Link Governance Controls", "Link Controls", "Detach Governance Controls", "Detach Controls",
57
+ ]
57
58
 
58
59
  GOV_COM_LIST = [ "Create Business Imperative", "Update Business Imperative",
59
60
  "Create Regulation Article Definition", "Update Regulation Article Definition",
@@ -131,8 +132,8 @@ command_list = ["Provenance", "Create Glossary", "Update Glossary", "Create Term
131
132
  "Create Digital Product", "Create Data Product", "Update Digital Product", "Update Data Product",
132
133
  "Create Agreement", "Update Agreement",
133
134
  "Link Digital Products", "Link Data Products", "Detach Digital Products", "Detach Data Products",
134
- # "Create Data Sharing Agreement", "Update Data Sharing Agreement",
135
- "Create Digital Subscription", "Create Product Subscription", "Update Digital Subscription", "Update Product Subscription",
135
+ "Create Data Sharing Agreement", "Update Data Sharing Agreement",
136
+ # "Create Digital Subscription", "Create Product Subscription", "Update Digital Subscription", "Update Product Subscription",
136
137
  "Attach Agreement Items", "Detach Agreement Items",
137
138
  "Attach Contract", "Detach Contract",
138
139
  "Attach Subscriber", "Detach Subscriber",
@@ -173,6 +174,8 @@ command_list.extend(GOV_COM_LIST)
173
174
  command_list.extend(GOV_LINK_LIST)
174
175
  command_list.extend(COLLECTIONS_LIST)
175
176
  command_list.extend(SIMPLE_COLLECTIONS)
177
+ command_list.extend(["Link Governance Response", "Detach Governance Response",
178
+ "Link Governance Mechanism", "Detach Governance Mechanism"])
176
179
 
177
180
  pre_command = "\n---\n==> Processing object_action:"
178
181
  command_seperator = Markdown("\n---\n")
pyegeria/.DS_Store ADDED
Binary file
pyegeria/__init__.py CHANGED
@@ -30,7 +30,7 @@ from ._client_new import Client2
30
30
  from ._exceptions_new import (PyegeriaInvalidParameterException,PyegeriaAPIException, PyegeriaException,
31
31
  PyegeriaUnauthorizedException, PyegeriaClientException, PyegeriaUnknownException,
32
32
  PyegeriaConnectionException, PyegeriaNotFoundException,
33
- print_exception_table, print_basic_exception)
33
+ print_exception_table, print_basic_exception, print_validation_error)
34
34
  from .load_config import load_app_config, get_app_config
35
35
  from .logging_configuration import config_logging, console_log_filter, init_logging
36
36
  from ._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
@@ -40,7 +40,7 @@ from ._validators import (is_json, validate_guid, validate_name, validate_public
40
40
  from .asset_catalog_omvs import AssetCatalog
41
41
  from .automated_curation_omvs import AutomatedCuration
42
42
  from .classification_manager_omvs import ClassificationManager
43
- from .collection_manager_omvs import CollectionManager
43
+ from .collection_manager import CollectionManager
44
44
  from .core_omag_server_config import CoreServerConfig
45
45
  from .create_tech_guid_lists import build_global_guid_lists
46
46
  from .egeria_cat_client import EgeriaCat
@@ -52,7 +52,7 @@ from .feedback_manager_omvs import FeedbackManager
52
52
  from .full_omag_server_config import FullServerConfig
53
53
  from .glossary_browser_omvs import GlossaryBrowser
54
54
  from .glossary_manager_omvs import GlossaryManager
55
- from .governance_officer_omvs import GovernanceOfficer
55
+ from .governance_officer import GovernanceOfficer
56
56
  from .mermaid_utilities import (construct_mermaid_web, construct_mermaid_jup, generate_process_graph, load_mermaid,
57
57
  parse_mermaid_code, render_mermaid, save_mermaid_graph, save_mermaid_html, )
58
58
  from .metadata_explorer_omvs import MetadataExplorer