pyegeria 5.4.2.3__py3-none-any.whl → 5.4.3.1__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 (27) hide show
  1. commands/cat/debug_log.2025-08-30_21-15-48_528443.log.zip +0 -0
  2. commands/cat/debug_log.log +9410 -1431
  3. commands/cat/dr_egeria_command_help.py +110 -7
  4. md_processing/__init__.py +6 -11
  5. md_processing/data/commands.json +150 -6
  6. md_processing/dr_egeria.py +7 -6
  7. md_processing/dr_egeria_inbox/glossary_test1.md +18 -3
  8. md_processing/dr_egeria_inbox/product.md +11 -11
  9. md_processing/dr_egeria_outbox/friday/processed-2025-08-31 20:57-glossary_test1.md +400 -0
  10. md_processing/dr_egeria_outbox/monday/processed-2025-09-01 09:26-product.md +210 -0
  11. md_processing/md_commands/glossary_commands.py +84 -459
  12. md_processing/md_commands/product_manager_commands.py +10 -7
  13. md_processing/md_commands/project_commands.py +2 -2
  14. md_processing/md_processing_utils/common_md_proc_utils.py +9 -6
  15. md_processing/md_processing_utils/common_md_utils.py +15 -13
  16. md_processing/md_processing_utils/extraction_utils.py +12 -3
  17. md_processing/md_processing_utils/md_processing_constants.py +5 -4
  18. pyegeria/__init__.py +2 -1
  19. pyegeria/config.py +292 -190
  20. pyegeria/glossary_manager.py +2 -2
  21. pyegeria/load_config.py +36 -0
  22. pyegeria-5.4.3.1.dist-info/METADATA +163 -0
  23. {pyegeria-5.4.2.3.dist-info → pyegeria-5.4.3.1.dist-info}/RECORD +26 -22
  24. pyegeria-5.4.2.3.dist-info/METADATA +0 -78
  25. {pyegeria-5.4.2.3.dist-info → pyegeria-5.4.3.1.dist-info}/LICENSE +0 -0
  26. {pyegeria-5.4.2.3.dist-info → pyegeria-5.4.3.1.dist-info}/WHEEL +0 -0
  27. {pyegeria-5.4.2.3.dist-info → pyegeria-5.4.3.1.dist-info}/entry_points.txt +0 -0
@@ -70,6 +70,9 @@ def parse_upsert_command(egeria_client: EgeriaTech, object_type: str, object_act
70
70
  labels = {}
71
71
 
72
72
  command_spec = get_command_spec(f"Create {object_type}")
73
+ if command_spec is None:
74
+ logger.error("Command not found in command spec")
75
+ raise Exception("Command not found in command spec")
73
76
  attributes = command_spec.get('Attributes', [])
74
77
  command_display_name = command_spec.get('display_name', None)
75
78
  command_qn_prefix = command_spec.get('qn_prefix', None)
@@ -378,20 +381,20 @@ def parse_view_command(egeria_client: EgeriaTech, object_type: str, object_actio
378
381
 
379
382
  parsed_output['guid'] = parsed_attributes[key].get('guid', None)
380
383
  parsed_output['qualified_name'] = parsed_attributes[key].get('qualified_name', None)
381
- parsed_output['exists'] = parsed_attributes[key]['exists']
382
- if parsed_attributes[key]['valid'] is False:
384
+ parsed_output['exists'] = parsed_attributes.get(key,{}).get('exists',None)
385
+ if parsed_attributes.get(key,{}).get('valid',None) is False:
383
386
  parsed_output['valid'] = False
384
- parsed_output['reason'] += parsed_attributes[key]['reason']
387
+ parsed_output['reason'] += parsed_attributes.get(key,{}).get('reason',None)
385
388
 
386
389
  elif style == 'Reference Name':
387
390
  parsed_attributes[key] = proc_ids(egeria_client, key, labels, txt, object_action, if_missing)
388
391
  if ((if_missing == ERROR) and parsed_attributes[key].get("value", None) is None):
389
- msg = f"Required parameter `{parsed_attributes[key]['value']}` is missing"
392
+ msg = f"Required parameter `{parsed_attributes.get(key,{}).get('value',None)}` is missing"
390
393
  logger.error(msg)
391
394
  parsed_output['valid'] = False
392
395
  parsed_output['reason'] += msg
393
- elif parsed_attributes[key]['value'] and parsed_attributes[key]['exists'] is False:
394
- msg = f"Reference Name `{parsed_attributes[key]['value']}` is specified but does not exist"
396
+ elif parsed_attributes.get(key,{}).get('value',None) and parsed_attributes.get(key,{}).get('exists',None) is False:
397
+ msg = f"Reference Name `{parsed_attributes.get(key,{}).get('value',None)}` is specified but does not exist"
395
398
  logger.error(msg)
396
399
  parsed_output['valid'] = False
397
400
  parsed_output['reason'] += msg
@@ -55,16 +55,6 @@ ALL_GOVERNANCE_DEFINITIONS = GENERAL_GOVERNANCE_DEFINITIONS + GOVERNANCE_CONTROL
55
55
  debug_level = DEBUG_LEVEL
56
56
  global COMMAND_DEFINITIONS
57
57
 
58
- # def setup_log():
59
- # logger.remove()
60
- # logger.add(sys.stderr, level="SUCCESS", format=CONSOLE_LOG_FORMAT, colorize=True)
61
- # full_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_INBOX_PATH, "data_designer_debug.log")
62
- # # logger.add(full_file_path, rotation="1 day", retention="1 week", compression="zip", level="TRACE", format=log_format,
63
- # # colorize=True)
64
- # logger.add("debug_log", rotation="1 day", retention="1 week", compression="zip", level="INFO", format=LOG_FORMAT,
65
- # colorize=True)
66
-
67
-
68
58
  def split_tb_string(input: str)-> [Any]:
69
59
  """Split the string and trim the items"""
70
60
  l = [item.strip() for item in re.split(r'[;,\n]+',input)] if input is not None else None
@@ -294,9 +284,21 @@ def set_update_body(object_type: str, attributes: dict)->dict:
294
284
  "mergeUpdate": attributes.get('Merge Update', {}).get('value', True),
295
285
  "properties": "",
296
286
  }
287
+ def set_rel_prop_body(object_type: str, attributes: dict)->dict:
288
+ prop_name = object_type.replace(" ", "")
289
+ display_name = attributes.get('Display Name', {}).get('value', None)
297
290
 
298
- def set_prop_body(object_type: str, qualified_name: str, attributes: dict)->dict:
291
+ return {
292
+ "class": prop_name + "Properties",
293
+ "description": attributes['Description'].get('value', None),
294
+ "label": attributes.get('Label', {}).get('value', None),
295
+ "typeName" : attributes.get('Type Name', {}).get('value', None),
296
+ "effectiveFrom": attributes.get('Effective From', {}).get('value', None),
297
+ "effectiveTo": attributes.get('Effective To', {}).get('value', None),
298
+ "extendedProperties": attributes.get('Extended Properties', {}).get('value', None),
299
+ }
299
300
 
301
+ def set_element_prop_body(object_type: str, qualified_name: str, attributes: dict)->dict:
300
302
  prop_name = object_type.replace(" ", "")
301
303
  display_name = attributes.get('Display Name', {}).get('value', None)
302
304
 
@@ -318,7 +320,7 @@ def set_prop_body(object_type: str, qualified_name: str, attributes: dict)->dict
318
320
  }
319
321
 
320
322
  def set_product_body(object_type: str, qualified_name: str, attributes: dict)->dict:
321
- prop_bod = set_prop_body(object_type, qualified_name, attributes)
323
+ prop_bod = set_element_prop_body(object_type, qualified_name, attributes)
322
324
  prop_bod["identifier"] = attributes.get('Identifier', {}).get('value', None)
323
325
  prop_bod["productName"] = attributes.get('Product Name', {}).get('value', None)
324
326
  prop_bod["maturity"] = attributes.get('Maturity', {}).get('value', None)
@@ -341,7 +343,7 @@ def set_update_status_body(object_type: str, attributes: dict)->dict:
341
343
 
342
344
  def set_gov_prop_body(object_type: str, qualified_name: str, attributes: dict)->dict:
343
345
  prop_name = object_type.replace(" ", "")
344
- prop_bod = set_prop_body(object_type, qualified_name, attributes)
346
+ prop_bod = set_element_prop_body(object_type, qualified_name, attributes)
345
347
  prop_bod["domainIdentifier"] = attributes.get('Domain Identifier', {}).get('value', None)
346
348
  prop_bod["displayName"]= attributes.get('Display Name', {}).get('value', None)
347
349
  prop_bod['qualifiedName'] = qualified_name
@@ -92,11 +92,20 @@ def extract_attribute(text: str, labels: set) -> str | None:
92
92
  for label in labels:
93
93
  # Construct pattern for the current label
94
94
  # text = re.sub(r'\s+', ' ', text).strip() # just added
95
- text = re.sub(r'\n\n+', '\n\n', text).strip()
95
+ # text = re.sub(r'\n\n+', '\n\n', text).strip()
96
96
 
97
- label = label.strip()
98
- pattern = rf"##\s*{re.escape(label)}\s*\n(?:\s*\n)*?(.*?)(?:#|___|$)"
97
+ # Replace multiple spaces or tabs with a single space
98
+ normalized = re.sub(r'\s+', ' ', text)
99
+ # Collapse multiple blank lines into a single one
100
+ normalized = re.sub(r'\n\s*\n', '\n', normalized).strip()
99
101
 
102
+ # label = label.strip()
103
+ # pattern = rf"##\s*{re.escape(label)}\s*\n(?:\s*\n)*?(.*?)(?:#|___|$)"
104
+ # Normalize the label
105
+ normalized_label = re.sub(r'\s+', ' ', label.strip())
106
+
107
+ # Construct the regex pattern
108
+ pattern = rf"##\s*{re.escape(normalized_label)}\s*\n(?:\s*\n)*?(.*?)(?:#|___|$)"
100
109
  # pattern = rf"##\s+{re.escape(label)}\n(.*?)(?:#|___|$)" # modified from --- to enable embedded tables
101
110
  match = re.search(pattern, text, re.DOTALL)
102
111
  if match:
@@ -144,8 +144,8 @@ command_list = ["Provenance", "Create Glossary", "Update Glossary", "Create Term
144
144
  "Link Information Supply Chain Peers", "Link Supply Chains", "Link Information Supply Chains",
145
145
  "Unlink Information Supply Chain Peers", "Unlink Information Supply Chains", "Unlink Supply Chains",
146
146
  "Create Solution Component", "Update Solution Component", "Link Solution Components", "Wire Solution Components",
147
- "Detach Solution Components", "Unlink Solution Components", "Create Term-Term Relationship",
148
- "Update Term-Term Relationship", "Create Data Spec", "Create Data Specification", "Update Data Spec",
147
+ "Detach Solution Components", "Unlink Solution Components", "Link Term-Term Relationship", "Link Terms", "Detach Terms",
148
+ "Detach Term-Term Relationship", "Create Data Spec", "Create Data Specification", "Update Data Spec",
149
149
  "Update Data Specification", "Create Data Field", "Update Data Field", "Create Data Structure",
150
150
  "Update Data Structure", "Create Data Dictionary", "Update Data Dictionary", "Create Data Dict",
151
151
  "Update Data Dict",
@@ -251,7 +251,8 @@ def does_command_match(command: str, alt_names: list[str]) -> bool:
251
251
  for primary_verb, synonyms in verbs_synonyms.items():
252
252
  for synonym in synonyms:
253
253
  for alt_name in alt_names:
254
- if f"{synonym} {alt_name}" == command:
254
+ tst = f"{synonym} {alt_name}"
255
+ if tst == command:
255
256
  return True
256
257
  return False
257
258
 
@@ -266,7 +267,7 @@ def find_alternate_names(command: str) -> str | None:
266
267
  verb = command.split()[0] if command else ""
267
268
  normalized_command = " ".join(command.split())
268
269
  # normalized_alternates = (" ".join(s.split()) for s in v)
269
- if (command in v):
270
+ if (normalized_command in v):
270
271
  return key
271
272
  elif does_command_match(normalized_command, v):
272
273
  return key
pyegeria/__init__.py CHANGED
@@ -17,7 +17,7 @@ from ._globals import (INTEGRATION_GUIDS, TEMPLATE_GUIDS, default_time_out, disa
17
17
  NO_CATALOGS_FOUND, NO_GLOSSARIES_FOUND, NO_TERMS_FOUND, NO_CATEGORIES_FOUND, NO_ELEMENT_FOUND,
18
18
  NO_PROJECTS_FOUND, DEBUG_LEVEL, NO_COLLECTION_FOUND, NO_GUID_RETURNED)
19
19
 
20
- from ._output_formats import select_output_format_set
20
+
21
21
 
22
22
  if disable_ssl_warnings:
23
23
  from urllib3 import disable_warnings
@@ -67,6 +67,7 @@ from .valid_metadata_omvs import ValidMetadataManager
67
67
  from .x_action_author_omvs import ActionAuthor
68
68
  from .template_manager_omvs import TemplateManager
69
69
  from .data_designer import DataDesigner
70
+ from ._output_formats import select_output_format_set
70
71
  #
71
72
  global template_guids, integration_guids
72
73