pyegeria 5.4.0.1__py3-none-any.whl → 5.4.0.3__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 (43) hide show
  1. commands/cat/__init__.py +1 -1
  2. commands/cat/dr_egeria_md.py +6 -4
  3. commands/cat/list_collections.py +47 -36
  4. md_processing/__init__.py +5 -2
  5. md_processing/data/commands-working.json +34850 -0
  6. md_processing/data/commands.json +1750 -530
  7. md_processing/md_commands/product_manager_commands.py +171 -220
  8. md_processing/md_processing_utils/common_md_proc_utils.py +9 -0
  9. md_processing/md_processing_utils/common_md_utils.py +15 -2
  10. md_processing/md_processing_utils/md_processing_constants.py +44 -6
  11. pyegeria/__init__.py +8 -4
  12. pyegeria/_client.py +2 -1
  13. pyegeria/_client_new.py +688 -0
  14. pyegeria/_exceptions_new.py +362 -0
  15. pyegeria/_globals.py +3 -1
  16. pyegeria/_output_formats.py +196 -0
  17. pyegeria/_validators.py +72 -199
  18. pyegeria/collection_manager_omvs.py +602 -324
  19. pyegeria/data_designer_omvs.py +251 -203
  20. pyegeria/load_config.py +217 -0
  21. pyegeria/logging_configuration.py +204 -0
  22. pyegeria/output_formatter.py +162 -31
  23. pyegeria/utils.py +99 -61
  24. {pyegeria-5.4.0.1.dist-info → pyegeria-5.4.0.3.dist-info}/METADATA +3 -1
  25. {pyegeria-5.4.0.1.dist-info → pyegeria-5.4.0.3.dist-info}/RECORD +28 -37
  26. commands/cat/debug_log +0 -2806
  27. commands/cat/debug_log.2025-07-15_14-28-38_087378.zip +0 -0
  28. commands/cat/debug_log.2025-07-16_15-48-50_037087.zip +0 -0
  29. md_processing/dr_egeria_outbox-pycharm/.obsidian/app.json +0 -1
  30. md_processing/dr_egeria_outbox-pycharm/.obsidian/appearance.json +0 -1
  31. md_processing/dr_egeria_outbox-pycharm/.obsidian/core-plugins.json +0 -31
  32. md_processing/dr_egeria_outbox-pycharm/.obsidian/workspace.json +0 -177
  33. md_processing/dr_egeria_outbox-pycharm/monday/processed-2025-07-14 12:38-data_designer_out.md +0 -663
  34. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 15:00-Derive-Dr-Gov-Defs.md +0 -719
  35. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:13-Derive-Dr-Gov-Defs.md +0 -41
  36. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:14-Derive-Dr-Gov-Defs.md +0 -33
  37. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:50-Derive-Dr-Gov-Defs.md +0 -192
  38. md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-16 19:15-gov_def2.md +0 -527
  39. md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-17 12:08-gov_def2.md +0 -527
  40. md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-17 14:27-gov_def2.md +0 -474
  41. {pyegeria-5.4.0.1.dist-info → pyegeria-5.4.0.3.dist-info}/LICENSE +0 -0
  42. {pyegeria-5.4.0.1.dist-info → pyegeria-5.4.0.3.dist-info}/WHEEL +0 -0
  43. {pyegeria-5.4.0.1.dist-info → pyegeria-5.4.0.3.dist-info}/entry_points.txt +0 -0
@@ -13,9 +13,11 @@ from os import terminal_size
13
13
  from httpx import Response
14
14
  from prompt_toolkit import data_structures
15
15
 
16
+ from pyegeria import select_output_format_set
16
17
  from pyegeria._client import Client, max_paging_size
17
18
  from pyegeria._globals import NO_ELEMENTS_FOUND
18
- from pyegeria.output_formatter import (extract_mermaid_only, extract_basic_dict, generate_output)
19
+ from pyegeria.output_formatter import (extract_mermaid_only, extract_basic_dict, generate_output,
20
+ _extract_referenceable_properties)
19
21
  from pyegeria.utils import body_slimmer
20
22
 
21
23
 
@@ -1113,7 +1115,7 @@ r replace_all_properties: bool, default = False
1113
1115
  loop.run_until_complete(self._async_delete_data_field(data_struct_guid, body, cascade))
1114
1116
 
1115
1117
  async def _async_find_all_data_structures(self, start_from: int = 0, page_size: int = max_paging_size,
1116
- output_format: str = "DICT") -> list | str:
1118
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1117
1119
  """Returns a list of all known data structures. Async version.
1118
1120
 
1119
1121
  Parameters
@@ -1124,7 +1126,8 @@ r replace_all_properties: bool, default = False
1124
1126
  - maximum number of elements to return.
1125
1127
  output_format: str, default = "DICT"
1126
1128
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
1127
-
1129
+ columns_struct: dict, optional, default = None
1130
+ - The desired output columns/field options.
1128
1131
  Returns
1129
1132
  -------
1130
1133
  [dict] | str
@@ -1154,11 +1157,11 @@ r replace_all_properties: bool, default = False
1154
1157
  if type(elements) is str:
1155
1158
  return NO_ELEMENTS_FOUND
1156
1159
  if output_format != 'JSON': # return other representations
1157
- return self.generate_data_structure_output(elements, filter, output_format)
1160
+ return self._generate_data_structure_output(elements, filter, output_format, columns_struct)
1158
1161
  return elements
1159
1162
 
1160
1163
  def find_all_data_structures(self, start_from: int = 0, page_size: int = max_paging_size,
1161
- output_format: str = "DICT") -> list | str:
1164
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1162
1165
  """ Returns a list of all known data structures.
1163
1166
 
1164
1167
  Parameters
@@ -1169,7 +1172,8 @@ r replace_all_properties: bool, default = False
1169
1172
  - maximum number of elements to return.
1170
1173
  output_format: str, default = "DICT"
1171
1174
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
1172
-
1175
+ columns_struct: dict, optional, default = None
1176
+ - The desired output columns/field options.
1173
1177
 
1174
1178
  Returns
1175
1179
  -------
@@ -1188,13 +1192,13 @@ r replace_all_properties: bool, default = False
1188
1192
  """
1189
1193
 
1190
1194
  loop = asyncio.get_event_loop()
1191
- response = loop.run_until_complete(self._async_find_all_data_structures(start_from, page_size, output_format))
1195
+ response = loop.run_until_complete(self._async_find_all_data_structures(start_from, page_size, output_format, columns_struct))
1192
1196
  return response
1193
1197
 
1194
1198
  async def _async_find_data_structures_w_body(self, body: dict, start_from: int = 0,
1195
1199
  page_size: int = max_paging_size, starts_with: bool = True,
1196
1200
  ends_with: bool = False, ignore_case: bool = True,
1197
- output_format: str = "DICT") -> list | str:
1201
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1198
1202
  """ Retrieve the list of data structure metadata elements that contain the search string.
1199
1203
  Async version.
1200
1204
 
@@ -1214,6 +1218,8 @@ r replace_all_properties: bool, default = False
1214
1218
  - If True, the case of the search string is ignored.
1215
1219
  output_format: str, default = "DICT"
1216
1220
  - output format of the data structure. Possible values: "DICT", 'REPORT', 'FORM', "JSON", "MERMAID".
1221
+ columns_struct: dict, optional, default = None
1222
+ - The desired output columns/field options.
1217
1223
 
1218
1224
  Returns
1219
1225
  -------
@@ -1260,12 +1266,12 @@ r replace_all_properties: bool, default = False
1260
1266
  if type(elements) is list and len(elements) == 0:
1261
1267
  return NO_ELEMENTS_FOUND
1262
1268
  if output_format != 'JSON': # return other representations
1263
- return self.generate_data_structure_output(elements, filter, output_format)
1269
+ return self._generate_data_structure_output(elements, filter, output_format, columns_struct)
1264
1270
  return elements
1265
1271
 
1266
1272
  def find_data_structures_w_body(self, body: dict, start_from: int = 0, page_size: int = max_paging_size,
1267
1273
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
1268
- output_format: str = "DICT") -> list | str:
1274
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1269
1275
  """ Retrieve the list of data structure metadata elements that contain the search string.
1270
1276
 
1271
1277
  Parameters
@@ -1284,7 +1290,8 @@ r replace_all_properties: bool, default = False
1284
1290
  - If True, the case of the search string is ignored.
1285
1291
  output_format: str, default = "DICT"
1286
1292
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
1287
-
1293
+ columns_struct: dict, optional, default = None
1294
+ - The desired output columns/field options.
1288
1295
  Returns
1289
1296
  -------
1290
1297
  [dict] | str
@@ -1318,12 +1325,12 @@ r replace_all_properties: bool, default = False
1318
1325
  loop = asyncio.get_event_loop()
1319
1326
  response = loop.run_until_complete(
1320
1327
  self._async_find_data_structures_w_body(body, start_from, page_size, starts_with, ends_with, ignore_case,
1321
- output_format))
1328
+ output_format, columns_struct))
1322
1329
  return response
1323
1330
 
1324
1331
  async def _async_find_data_structures(self, filter: str, start_from: int = 0, page_size: int = max_paging_size,
1325
1332
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
1326
- output_format: str = "DICT") -> list | str:
1333
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1327
1334
  """ Find the list of data structure metadata elements that contain the search string.
1328
1335
  Async version.
1329
1336
 
@@ -1343,7 +1350,8 @@ r replace_all_properties: bool, default = False
1343
1350
  - If True, the case of the search string is ignored.
1344
1351
  output_format: str, default = "DICT"
1345
1352
  - one of "DICT", "MERMAID" or "JSON"
1346
-
1353
+ columns_struct: dict, optional, default = None
1354
+ - The desired output columns/field options.
1347
1355
  Returns
1348
1356
  -------
1349
1357
  [dict] | str
@@ -1383,12 +1391,12 @@ r replace_all_properties: bool, default = False
1383
1391
  return NO_ELEMENTS_FOUND
1384
1392
 
1385
1393
  if output_format != 'JSON': # return a simplified markdown representation
1386
- return self.generate_data_structure_output(elements, filter, output_format)
1394
+ return self._generate_data_structure_output(elements, filter, output_format, columns_struct)
1387
1395
  return elements
1388
1396
 
1389
1397
  def find_data_structures(self, filter: str, start_from: int = 0, page_size: int = max_paging_size,
1390
1398
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
1391
- output_format: str = "DICT") -> list | str:
1399
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1392
1400
  """ Retrieve the list of data structure metadata elements that contain the search string filter.
1393
1401
 
1394
1402
  Parameters
@@ -1408,6 +1416,9 @@ r replace_all_properties: bool, default = False
1408
1416
  output_format: str, default = "DICT"
1409
1417
  output_format: str, default = "DICT"
1410
1418
  - one of "DICT", "MERMAID" or "JSON"
1419
+ columns_struct: dict, optional, default = None
1420
+ - The desired output columns/field options.
1421
+
1411
1422
  Returns
1412
1423
  -------
1413
1424
  [dict] | str
@@ -1428,12 +1439,12 @@ r replace_all_properties: bool, default = False
1428
1439
  loop = asyncio.get_event_loop()
1429
1440
  response = loop.run_until_complete(
1430
1441
  self._async_find_data_structures(filter, start_from, page_size, starts_with, ends_with, ignore_case,
1431
- output_format))
1442
+ output_format, columns_struct))
1432
1443
  return response
1433
1444
 
1434
1445
  async def _async_get_data_structures_by_name(self, filter: str, body: dict = None, start_from: int = 0,
1435
1446
  page_size: int = max_paging_size,
1436
- output_format: str = "DICT") -> list | str:
1447
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1437
1448
  """ Get the list of data structure metadata elements with a matching name to the search string filter.
1438
1449
  Async version.
1439
1450
 
@@ -1449,6 +1460,9 @@ r replace_all_properties: bool, default = False
1449
1460
  - maximum number of elements to return.
1450
1461
  output_format: str, default = "DICT"
1451
1462
  - one of "DICT", "MERMAID" or "JSON"
1463
+ columns_struct: dict, optional, default = None
1464
+ - The desired output columns/field options.
1465
+
1452
1466
  Returns
1453
1467
  -------
1454
1468
  [dict] | str
@@ -1491,11 +1505,11 @@ r replace_all_properties: bool, default = False
1491
1505
  if type(elements) is str:
1492
1506
  return NO_ELEMENTS_FOUND
1493
1507
  if output_format != 'JSON': # return other representations
1494
- return self.generate_data_structure_output(elements, filter, output_format)
1508
+ return self._generate_data_structure_output(elements, filter, output_format, columns_struct)
1495
1509
  return elements
1496
1510
 
1497
1511
  def get_data_structures_by_name(self, filter: str, body: dict = None, start_from: int = 0,
1498
- page_size: int = max_paging_size, output_format: str = "DICT") -> list | str:
1512
+ page_size: int = max_paging_size, output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1499
1513
  """ Get the list of data structure metadata elements with a matching name to the search string filter.
1500
1514
 
1501
1515
  Parameters
@@ -1510,6 +1524,8 @@ r replace_all_properties: bool, default = False
1510
1524
  - maximum number of elements to return.
1511
1525
  output_format: str, default = "DICT"
1512
1526
  - one of "DICT", "MERMAID" or "JSON"
1527
+ columns_struct: dict, optional, default = None
1528
+ - The desired output columns/field options.
1513
1529
 
1514
1530
  Returns
1515
1531
  -------
@@ -1530,11 +1546,11 @@ r replace_all_properties: bool, default = False
1530
1546
 
1531
1547
  loop = asyncio.get_event_loop()
1532
1548
  response = loop.run_until_complete(
1533
- self._async_get_data_structures_by_name(filter, body, start_from, page_size, output_format))
1549
+ self._async_get_data_structures_by_name(filter, body, start_from, page_size, output_format, columns_struct))
1534
1550
  return response
1535
1551
 
1536
1552
  async def _async_get_data_structure_by_guid(self, guid: str, body: dict = None,
1537
- output_format: str = "DICT") -> list | str:
1553
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1538
1554
  """ Get the data structure metadata elements for the specified GUID.
1539
1555
  Async version.
1540
1556
 
@@ -1546,6 +1562,9 @@ r replace_all_properties: bool, default = False
1546
1562
  - optional request body.
1547
1563
  output_format: str, default = "DICT"
1548
1564
  - one of "DICT", "MERMAID" or "JSON"
1565
+ columns_struct: dict, optional, default = None
1566
+ - The desired output columns/field options.
1567
+
1549
1568
  Returns
1550
1569
  -------
1551
1570
  [dict] | str
@@ -1584,10 +1603,10 @@ r replace_all_properties: bool, default = False
1584
1603
  if type(element) is str:
1585
1604
  return NO_ELEMENTS_FOUND
1586
1605
  if output_format != 'JSON': # return other representations
1587
- return self.generate_data_structure_output(element, filter, output_format)
1606
+ return self._generate_data_structure_output(element, filter, output_format, columns_struct)
1588
1607
  return element
1589
1608
 
1590
- def get_data_structure_by_guid(self, guid: str, body: str = None, output_format: str = "DICT") -> list | str:
1609
+ def get_data_structure_by_guid(self, guid: str, body: str = None, output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1591
1610
  """ Get the data structure metadata element with the specified unique identifier..
1592
1611
 
1593
1612
  Parameters
@@ -1598,6 +1617,9 @@ r replace_all_properties: bool, default = False
1598
1617
  - optional request body.
1599
1618
  output_format: str, default = "DICT"
1600
1619
  - one of "DICT", "MERMAID" or "JSON"
1620
+ columns_struct: dict, optional, default = None
1621
+ - The desired output columns/field options.
1622
+
1601
1623
  Returns
1602
1624
  -------
1603
1625
  [dict] | str
@@ -1627,7 +1649,7 @@ r replace_all_properties: bool, default = False
1627
1649
  """
1628
1650
 
1629
1651
  loop = asyncio.get_event_loop()
1630
- response = loop.run_until_complete(self._async_get_data_structure_by_guid(guid, body, output_format))
1652
+ response = loop.run_until_complete(self._async_get_data_structure_by_guid(guid, body, output_format, columns_struct))
1631
1653
  return response
1632
1654
 
1633
1655
  #
@@ -2457,7 +2479,7 @@ r replace_all_properties: bool, default = False
2457
2479
  loop.run_until_complete(self._async_delete_data_field(data_field_guid, body, cascade))
2458
2480
 
2459
2481
  async def _async_find_all_data_fields(self, start_from: int = 0, page_size: int = max_paging_size,
2460
- output_format: str = "DICT") -> list | str:
2482
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
2461
2483
  """Returns a list of all known data fields. Async version.
2462
2484
 
2463
2485
  Parameters
@@ -2468,7 +2490,8 @@ r replace_all_properties: bool, default = False
2468
2490
  - maximum number of elements to return.
2469
2491
  output_format: str, default = "DICT"
2470
2492
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
2471
-
2493
+ columns_struct: dict, optional, default = None
2494
+ - The desired output columns/field options.
2472
2495
 
2473
2496
  Returns
2474
2497
  -------
@@ -2499,11 +2522,11 @@ r replace_all_properties: bool, default = False
2499
2522
  if type(elements) is str:
2500
2523
  return NO_ELEMENTS_FOUND
2501
2524
  if output_format != 'JSON': # return other representations
2502
- return self.generate_data_field_output(elements, filter, output_format)
2525
+ return self._generate_data_field_output(elements, filter, output_format, columns_struct)
2503
2526
  return elements
2504
2527
 
2505
2528
  def find_all_data_fields(self, start_from: int = 0, page_size: int = max_paging_size,
2506
- output_format: str = "DICT") -> list | str:
2529
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
2507
2530
  """ Returns a list of all known data fields.
2508
2531
 
2509
2532
  Parameters
@@ -2514,6 +2537,8 @@ r replace_all_properties: bool, default = False
2514
2537
  - maximum number of elements to return.
2515
2538
  output_format: str, default = "DICT"
2516
2539
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
2540
+ columns_struct: dict, optional, default = None
2541
+ - The desired output columns/field options.
2517
2542
 
2518
2543
  Returns
2519
2544
  -------
@@ -2532,12 +2557,12 @@ r replace_all_properties: bool, default = False
2532
2557
  """
2533
2558
 
2534
2559
  loop = asyncio.get_event_loop()
2535
- response = loop.run_until_complete(self._async_find_all_data_fields(start_from, page_size, output_format))
2560
+ response = loop.run_until_complete(self._async_find_all_data_fields(start_from, page_size, output_format,columns_struct))
2536
2561
  return response
2537
2562
 
2538
2563
  async def _async_find_data_fields_w_body(self, body: dict, start_from: int = 0, page_size: int = max_paging_size,
2539
2564
  starts_with: bool = True, ends_with: bool = False,
2540
- ignore_case: bool = True, output_format: str = "DICT") -> list | str:
2565
+ ignore_case: bool = True, output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
2541
2566
  """ Retrieve the list of data class metadata elements that contain the search string.
2542
2567
  Async version.
2543
2568
 
@@ -2557,6 +2582,8 @@ r replace_all_properties: bool, default = False
2557
2582
  - If True, the case of the search string is ignored.
2558
2583
  output_format: str, default = "DICT"
2559
2584
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
2585
+ columns_struct: dict, optional, default = None
2586
+ - The desired output columns/field options.
2560
2587
 
2561
2588
 
2562
2589
  Returns
@@ -2606,12 +2633,12 @@ r replace_all_properties: bool, default = False
2606
2633
  if type(elements) is str:
2607
2634
  return NO_ELEMENTS_FOUND
2608
2635
  if output_format != 'JSON': # return other representations
2609
- return self.generate_data_field_output(elements, filter, output_format)
2636
+ return self._generate_data_field_output(elements, filter, output_format, columns_struct)
2610
2637
  return elements
2611
2638
 
2612
2639
  def find_data_fields_w_body(self, body: dict, start_from: int = 0, page_size: int = max_paging_size,
2613
2640
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
2614
- output_format: str = "DICT") -> list | str:
2641
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
2615
2642
  """ Retrieve the list of data class metadata elements that contain the search string.
2616
2643
 
2617
2644
  Parameters
@@ -2630,6 +2657,8 @@ r replace_all_properties: bool, default = False
2630
2657
  - If True, the case of the search string is ignored.
2631
2658
  output_format: str, default = "DICT"
2632
2659
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
2660
+ columns_struct: dict, optional, default = None
2661
+ - The desired output columns/field options.
2633
2662
 
2634
2663
 
2635
2664
  Returns
@@ -2665,12 +2694,12 @@ r replace_all_properties: bool, default = False
2665
2694
  loop = asyncio.get_event_loop()
2666
2695
  response = loop.run_until_complete(
2667
2696
  self._async_find_data_fields_w_body(body, start_from, page_size, starts_with, ends_with, ignore_case,
2668
- output_format))
2697
+ output_format,columns_struct))
2669
2698
  return response
2670
2699
 
2671
2700
  async def _async_find_data_fields(self, filter: str, start_from: int = 0, page_size: int = max_paging_size,
2672
2701
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
2673
- output_format: str = "DICT") -> list | str:
2702
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
2674
2703
  """ Find the list of data class elements that contain the search string.
2675
2704
  Async version.
2676
2705
 
@@ -2690,7 +2719,8 @@ r replace_all_properties: bool, default = False
2690
2719
  - If True, the case of the search string is ignored.
2691
2720
  output_format: str, default = "DICT"
2692
2721
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
2693
-
2722
+ columns_struct: dict, optional, default = None
2723
+ - The desired output columns/field options.
2694
2724
 
2695
2725
  Returns
2696
2726
  -------
@@ -2726,12 +2756,12 @@ r replace_all_properties: bool, default = False
2726
2756
  if type(elements) is str:
2727
2757
  return NO_ELEMENTS_FOUND
2728
2758
  if output_format != 'JSON': # return other representations
2729
- return self.generate_data_field_output(elements, filter, output_format)
2759
+ return self._generate_data_field_output(elements, filter, output_format, columns_struct)
2730
2760
  return elements
2731
2761
 
2732
2762
  def find_data_fields(self, filter: str, start_from: int = 0, page_size: int = max_paging_size,
2733
2763
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
2734
- output_format: str = "DICT") -> list | str:
2764
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
2735
2765
  """ Retrieve the list of data fields elements that contain the search string filter.
2736
2766
 
2737
2767
  Parameters
@@ -2750,7 +2780,8 @@ r replace_all_properties: bool, default = False
2750
2780
  - If True, the case of the search string is ignored.
2751
2781
  output_format: str, default = "DICT"
2752
2782
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
2753
-
2783
+ columns_struct: dict, optional, default = None
2784
+ - The desired output columns/field options.
2754
2785
 
2755
2786
  Returns
2756
2787
  -------
@@ -2772,12 +2803,12 @@ r replace_all_properties: bool, default = False
2772
2803
  loop = asyncio.get_event_loop()
2773
2804
  response = loop.run_until_complete(
2774
2805
  self._async_find_data_fields(filter, start_from, page_size, starts_with, ends_with, ignore_case,
2775
- output_format))
2806
+ output_format, columns_struct))
2776
2807
  return response
2777
2808
 
2778
2809
  async def _async_get_data_fields_by_name(self, filter: str, body: dict = None, start_from: int = 0,
2779
2810
  page_size: int = max_paging_size,
2780
- output_format: str = "DICT") -> list | str:
2811
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
2781
2812
  """ Get the list of data class metadata elements with a matching name to the search string filter.
2782
2813
  Async version.
2783
2814
 
@@ -2793,7 +2824,8 @@ r replace_all_properties: bool, default = False
2793
2824
  - maximum number of elements to return.
2794
2825
  output_format: str, default = "DICT"
2795
2826
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
2796
-
2827
+ columns_struct: dict, optional, default = None
2828
+ - The desired output columns/field options.
2797
2829
 
2798
2830
  Returns
2799
2831
  -------
@@ -2837,11 +2869,11 @@ r replace_all_properties: bool, default = False
2837
2869
  if type(elements) is str:
2838
2870
  return NO_ELEMENTS_FOUND
2839
2871
  if output_format != 'JSON': # return other representations
2840
- return self.generate_data_field_output(elements, filter, output_format)
2872
+ return self._generate_data_field_output(elements, filter, output_format, columns_struct)
2841
2873
  return elements
2842
2874
 
2843
2875
  def get_data_fields_by_name(self, filter: str, body: dict = None, start_from: int = 0,
2844
- page_size: int = max_paging_size, output_format: str = "DICT") -> list | str:
2876
+ page_size: int = max_paging_size, output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
2845
2877
  """ Get the list of data class elements with a matching name to the search string filter.
2846
2878
 
2847
2879
  Parameters
@@ -2856,7 +2888,8 @@ r replace_all_properties: bool, default = False
2856
2888
  - maximum number of elements to return.
2857
2889
  output_format: str, default = "DICT"
2858
2890
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
2859
-
2891
+ columns_struct: dict, optional, default = None
2892
+ - The desired output columns/field options.
2860
2893
 
2861
2894
  Returns
2862
2895
  -------
@@ -2891,11 +2924,11 @@ r replace_all_properties: bool, default = False
2891
2924
 
2892
2925
  loop = asyncio.get_event_loop()
2893
2926
  response = loop.run_until_complete(
2894
- self._async_get_data_fields_by_name(filter, body, start_from, page_size, output_format))
2927
+ self._async_get_data_fields_by_name(filter, body, start_from, page_size, output_format, columns_struct))
2895
2928
  return response
2896
2929
 
2897
2930
  async def _async_get_data_field_by_guid(self, guid: str, body: dict = None,
2898
- output_format: str = "DICT") -> list | str:
2931
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
2899
2932
  """ Get the data class elements for the specified GUID.
2900
2933
  Async version.
2901
2934
 
@@ -2907,6 +2940,8 @@ r replace_all_properties: bool, default = False
2907
2940
  - optional request body.
2908
2941
  output_format: str, default = "DICT"
2909
2942
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
2943
+ columns_struct: dict, optional, default = None
2944
+ - The desired output columns/field options.
2910
2945
 
2911
2946
  Returns
2912
2947
  -------
@@ -2947,10 +2982,10 @@ r replace_all_properties: bool, default = False
2947
2982
  if type(elements) is str:
2948
2983
  return NO_ELEMENTS_FOUND
2949
2984
  if output_format != 'JSON': # return other representations
2950
- return self.generate_data_field_output(elements, None, output_format)
2985
+ return self._generate_data_field_output(elements, None, output_format, columns_struct)
2951
2986
  return elements
2952
2987
 
2953
- def get_data_field_by_guid(self, guid: str, body: str = None, output_format: str = "DICT") -> list | str:
2988
+ def get_data_field_by_guid(self, guid: str, body: str = None, output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
2954
2989
  """ Get the data structure metadata element with the specified unique identifier..
2955
2990
 
2956
2991
  Parameters
@@ -2961,6 +2996,8 @@ r replace_all_properties: bool, default = False
2961
2996
  - optional request body.
2962
2997
  output_format: str, default = "DICT"
2963
2998
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
2999
+ columns_struct: dict, optional, default = None
3000
+ - The desired output columns/field options.
2964
3001
 
2965
3002
  Returns
2966
3003
  -------
@@ -2991,7 +3028,7 @@ r replace_all_properties: bool, default = False
2991
3028
  """
2992
3029
 
2993
3030
  loop = asyncio.get_event_loop()
2994
- response = loop.run_until_complete(self._async_get_data_field_by_guid(guid, body, output_format))
3031
+ response = loop.run_until_complete(self._async_get_data_field_by_guid(guid, body, output_format, columns_struct))
2995
3032
  return response
2996
3033
 
2997
3034
  ###
@@ -4024,7 +4061,7 @@ r replace_all_properties: bool, default = False
4024
4061
  loop.run_until_complete(self._async_delete_data_class(data_class_guid, body, cascade))
4025
4062
 
4026
4063
  async def _async_find_all_data_classes(self, start_from: int = 0, page_size: int = max_paging_size,
4027
- output_format: str = "DICT") -> list | str:
4064
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
4028
4065
  """ Returns a list of all data classes. Async version.
4029
4066
 
4030
4067
  Parameters
@@ -4035,6 +4072,8 @@ r replace_all_properties: bool, default = False
4035
4072
  - maximum number of elements to return.
4036
4073
  output_format: str, default = "DICT"
4037
4074
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
4075
+ columns_struct: dict, optional, default = None
4076
+ - The desired output columns/field options.
4038
4077
 
4039
4078
 
4040
4079
  Returns
@@ -4066,11 +4105,11 @@ r replace_all_properties: bool, default = False
4066
4105
  if type(elements) is str:
4067
4106
  return NO_ELEMENTS_FOUND
4068
4107
  if output_format != 'JSON': # return other representations
4069
- return self.generate_data_class_output(elements, filter, output_format)
4108
+ return self._generate_data_class_output(elements, filter, output_format, columns_struct)
4070
4109
  return elements
4071
4110
 
4072
4111
  def find_all_data_classes(self, start_from: int = 0, page_size: int = max_paging_size,
4073
- output_format: str = "DICT") -> list | str:
4112
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
4074
4113
  """ Returns a list of all data classes.
4075
4114
 
4076
4115
  Parameters
@@ -4081,7 +4120,8 @@ r replace_all_properties: bool, default = False
4081
4120
  - maximum number of elements to return.
4082
4121
  output_format: str, default = "DICT"
4083
4122
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
4084
-
4123
+ columns_struct: dict, optional, default = None
4124
+ - The desired output columns/field options.
4085
4125
 
4086
4126
  Returns
4087
4127
  -------
@@ -4100,12 +4140,12 @@ r replace_all_properties: bool, default = False
4100
4140
  """
4101
4141
 
4102
4142
  loop = asyncio.get_event_loop()
4103
- response = loop.run_until_complete(self._async_find_all_data_classes(start_from, page_size, output_format))
4143
+ response = loop.run_until_complete(self._async_find_all_data_classes(start_from, page_size, output_format, columns_struct))
4104
4144
  return response
4105
4145
 
4106
4146
  async def _async_find_data_classes_w_body(self, body: dict, start_from: int = 0, page_size: int = max_paging_size,
4107
4147
  starts_with: bool = True, ends_with: bool = False,
4108
- ignore_case: bool = True, output_format: str = "DICT") -> list | str:
4148
+ ignore_case: bool = True, output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
4109
4149
  """ Retrieve the list of data class metadata elements that contain the search string.
4110
4150
  Async version.
4111
4151
 
@@ -4125,6 +4165,8 @@ r replace_all_properties: bool, default = False
4125
4165
  - If True, the case of the search string is ignored.
4126
4166
  output_format: str, default = "DICT"
4127
4167
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
4168
+ columns_struct: dict, optional, default = None
4169
+ - The desired output columns/field options.
4128
4170
 
4129
4171
 
4130
4172
  Returns
@@ -4173,12 +4215,12 @@ r replace_all_properties: bool, default = False
4173
4215
  if type(elements) is str:
4174
4216
  return NO_ELEMENTS_FOUND
4175
4217
  if output_format != 'JSON': # return other representations
4176
- return self.generate_data_class_output(elements, filter, output_format)
4218
+ return self._generate_data_class_output(elements, filter, output_format, columns_struct)
4177
4219
  return elements
4178
4220
 
4179
4221
  def find_data_classes_w_body(self, body: dict, start_from: int = 0, page_size: int = max_paging_size,
4180
4222
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
4181
- output_format: str = "DICT") -> list | str:
4223
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
4182
4224
  """ Retrieve the list of data class metadata elements that contain the search string.
4183
4225
 
4184
4226
  Parameters
@@ -4197,6 +4239,8 @@ r replace_all_properties: bool, default = False
4197
4239
  - If True, the case of the search string is ignored.
4198
4240
  output_format: str, default = "DICT"
4199
4241
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
4242
+ columns_struct: dict, optional, default = None
4243
+ - The desired output columns/field options.
4200
4244
 
4201
4245
 
4202
4246
  Returns
@@ -4232,12 +4276,12 @@ r replace_all_properties: bool, default = False
4232
4276
  loop = asyncio.get_event_loop()
4233
4277
  response = loop.run_until_complete(
4234
4278
  self._async_find_data_classes_w_body(body, start_from, page_size, starts_with, ends_with, ignore_case,
4235
- output_format))
4279
+ output_format, columns_struct))
4236
4280
  return response
4237
4281
 
4238
4282
  async def _async_find_data_classes(self, filter: str, start_from: int = 0, page_size: int = max_paging_size,
4239
4283
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
4240
- output_format: str = "DICT") -> list | str:
4284
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
4241
4285
  """ Find the list of data class elements that contain the search string.
4242
4286
  Async version.
4243
4287
 
@@ -4257,6 +4301,8 @@ r replace_all_properties: bool, default = False
4257
4301
  - If True, the case of the search string is ignored.
4258
4302
  output_format: str, default = "DICT"
4259
4303
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
4304
+ columns_struct: dict, optional, default = None
4305
+ - The desired output columns/field options.
4260
4306
 
4261
4307
 
4262
4308
  Returns
@@ -4295,12 +4341,12 @@ r replace_all_properties: bool, default = False
4295
4341
  if type(elements) is str:
4296
4342
  return NO_ELEMENTS_FOUND
4297
4343
  if output_format != 'JSON': # return other representations
4298
- return self.generate_data_class_output(elements, filter, output_format)
4344
+ return self._generate_data_class_output(elements, filter, output_format, columns_struct)
4299
4345
  return elements
4300
4346
 
4301
4347
  def find_data_classes(self, filter: str, start_from: int = 0, page_size: int = max_paging_size,
4302
4348
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
4303
- output_format: str = "DICT") -> list | str:
4349
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
4304
4350
  """ Retrieve the list of data fields elements that contain the search string filter.
4305
4351
 
4306
4352
  Parameters
@@ -4319,6 +4365,8 @@ r replace_all_properties: bool, default = False
4319
4365
  - If True, the case of the search string is ignored.
4320
4366
  output_format: str, default = "DICT"
4321
4367
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
4368
+ columns_struct: dict, optional, default = None
4369
+ - The desired output columns/field options.
4322
4370
 
4323
4371
 
4324
4372
  Returns
@@ -4341,12 +4389,12 @@ r replace_all_properties: bool, default = False
4341
4389
  loop = asyncio.get_event_loop()
4342
4390
  response = loop.run_until_complete(
4343
4391
  self._async_find_data_classes(filter, start_from, page_size, starts_with, ends_with, ignore_case,
4344
- output_format))
4392
+ output_format, columns_struct))
4345
4393
  return response
4346
4394
 
4347
4395
  async def _async_get_data_classes_by_name(self, filter: str, body: dict = None, start_from: int = 0,
4348
4396
  page_size: int = max_paging_size,
4349
- output_format: str = "DICT") -> list | str:
4397
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
4350
4398
  """ Get the list of data class metadata elements with a matching name to the search string filter.
4351
4399
  Async version.
4352
4400
 
@@ -4362,7 +4410,8 @@ r replace_all_properties: bool, default = False
4362
4410
  - maximum number of elements to return.
4363
4411
  output_format: str, default = "DICT"
4364
4412
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
4365
-
4413
+ columns_struct: dict, optional, default = None
4414
+ - The desired output columns/field options.
4366
4415
 
4367
4416
  Returns
4368
4417
  -------
@@ -4406,11 +4455,11 @@ r replace_all_properties: bool, default = False
4406
4455
  if type(elements) is str:
4407
4456
  return NO_ELEMENTS_FOUND
4408
4457
  if output_format != 'JSON': # return other representations
4409
- return self.generate_data_class_output(elements, filter, output_format)
4458
+ return self._generate_data_class_output(elements, filter, output_format, columns_struct)
4410
4459
  return elements
4411
4460
 
4412
4461
  def get_data_classes_by_name(self, filter: str, body: dict = None, start_from: int = 0,
4413
- page_size: int = max_paging_size, output_format: str = "DICT") -> list | str:
4462
+ page_size: int = max_paging_size, output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
4414
4463
  """ Get the list of data class elements with a matching name to the search string filter.
4415
4464
 
4416
4465
  Parameters
@@ -4425,6 +4474,8 @@ r replace_all_properties: bool, default = False
4425
4474
  - maximum number of elements to return.
4426
4475
  output_format: str, default = "DICT"
4427
4476
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
4477
+ columns_struct: dict, optional, default = None
4478
+ - The desired output columns/field options.
4428
4479
 
4429
4480
 
4430
4481
  Returns
@@ -4460,11 +4511,11 @@ r replace_all_properties: bool, default = False
4460
4511
 
4461
4512
  loop = asyncio.get_event_loop()
4462
4513
  response = loop.run_until_complete(
4463
- self._async_get_data_classes_by_name(filter, body, start_from, page_size, output_format))
4514
+ self._async_get_data_classes_by_name(filter, body, start_from, page_size, output_format, columns_struct))
4464
4515
  return response
4465
4516
 
4466
4517
  async def _async_get_data_class_by_guid(self, guid: str, body: dict = None,
4467
- output_format: str = "DICT") -> list | str:
4518
+ output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
4468
4519
  """ Get the data class elements for the specified GUID.
4469
4520
  Async version.
4470
4521
 
@@ -4476,6 +4527,8 @@ r replace_all_properties: bool, default = False
4476
4527
  - optional request body.
4477
4528
  output_format: str, default = "DICT"
4478
4529
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
4530
+ columns_struct: dict, optional, default = None
4531
+ - The desired output columns/field options.
4479
4532
 
4480
4533
  Returns
4481
4534
  -------
@@ -4515,10 +4568,10 @@ r replace_all_properties: bool, default = False
4515
4568
  if type(elements) is str:
4516
4569
  return NO_ELEMENTS_FOUND
4517
4570
  if output_format != 'JSON': # return other representations
4518
- return self.generate_data_class_output(elements, filter, output_format)
4571
+ return self._generate_data_class_output(elements, filter, output_format, columns_struct)
4519
4572
  return elements
4520
4573
 
4521
- def get_data_class_by_guid(self, guid: str, body: str = None, output_format: str = "DICT") -> list | str:
4574
+ def get_data_class_by_guid(self, guid: str, body: str = None, output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
4522
4575
  """ Get the data structure metadata element with the specified unique identifier..
4523
4576
 
4524
4577
  Parameters
@@ -4529,6 +4582,8 @@ r replace_all_properties: bool, default = False
4529
4582
  - optional request body.
4530
4583
  output_format: str, default = "DICT"
4531
4584
  - output format of the data structure. Possible values: "DICT", "JSON", "MERMAID".
4585
+ columns_struct: dict, optional, default = None
4586
+ - The desired output columns/field options.
4532
4587
 
4533
4588
  Returns
4534
4589
  -------
@@ -4559,7 +4614,7 @@ r replace_all_properties: bool, default = False
4559
4614
  """
4560
4615
 
4561
4616
  loop = asyncio.get_event_loop()
4562
- response = loop.run_until_complete(self._async_get_data_class_by_guid(guid, body, output_format))
4617
+ response = loop.run_until_complete(self._async_get_data_class_by_guid(guid, body, output_format, columns_struct))
4563
4618
  return response
4564
4619
 
4565
4620
  ###
@@ -5177,34 +5232,29 @@ r replace_all_properties: bool, default = False
5177
5232
  Returns:
5178
5233
  dict: Dictionary of extracted properties
5179
5234
  """
5180
- guid = element['elementHeader'].get("guid", None)
5181
- properties = element.get('properties', {})
5182
- display_name = properties.get("displayName", "") or ""
5183
- description = properties.get("description", "") or ""
5184
- qualified_name = properties.get("qualifiedName", "") or ""
5185
- namespace = properties.get("namespace", "") or ""
5186
- version_id = properties.get("versionIdentifier", "") or ""
5235
+ props = _extract_referenceable_properties(element)
5236
+
5237
+ props['properties'] = element.get('properties', {})
5187
5238
 
5188
- # Get data type from extendedProperties and additionalProperties if available
5189
- extended_properties = properties.get("extendedProperties", {})
5190
- additional_properties = properties.get("additionalProperties", {})
5239
+ props['namespace'] = props['properties'].get("namespace", "") or ""
5240
+
5241
+ classification_names = []
5242
+ for c in props['classifications']:
5243
+ classification_names.append(c.get("classificationName", None))
5244
+ props['classifications'] = classification_names
5191
5245
 
5192
5246
  # Now lets get the related elements
5193
5247
  associated_elements = self.get_data_rel_elements_dict(element)
5194
- data_specs = associated_elements.get("member_of_data_spec_qnames", [])
5248
+ props['data_specs'] = associated_elements.get("member_of_data_spec_qnames", [])
5249
+
5195
5250
  # data_structures = associated_elements.get("member_of_data_struct_qnames", [])
5196
- assigned_meanings = associated_elements.get("assigned_meanings_qnames", [])
5197
- parent_names = associated_elements.get("parent_qnames", [])
5198
- member_data_fields = associated_elements.get("member_data_field_qnames", [])
5251
+ props['assigned_meanings'] = associated_elements.get("assigned_meanings_qnames", [])
5252
+ props['parent_names'] = associated_elements.get("parent_qnames", [])
5253
+ props['member_data_fields'] = associated_elements.get("member_data_field_qnames", [])
5199
5254
 
5200
- mermaid = element.get('mermaidGraph', "") or ""
5201
- # mermaid_md = "```mermaid\n" + mermaid + "\n```"
5255
+ props['mermaid'] = element.get('mermaidGraph', "") or ""
5202
5256
 
5203
- return {
5204
- 'GUID': guid, 'display_name': display_name, 'qualified_name': qualified_name, 'description': description, 'data_fields': member_data_fields,
5205
- 'data_specification': data_specs, 'namespace': namespace, 'version_identifier': version_id, 'properties': properties,
5206
- 'extended_properties': extended_properties, 'additional_properties': additional_properties, 'mermaid': mermaid
5207
- }
5257
+ return props
5208
5258
 
5209
5259
  def _extract_data_class_properties(self, element: dict) -> dict:
5210
5260
  """
@@ -5216,44 +5266,35 @@ r replace_all_properties: bool, default = False
5216
5266
  Returns:
5217
5267
  dict: Dictionary of extracted properties
5218
5268
  """
5219
- guid = element['elementHeader'].get("guid", None)
5269
+ props = _extract_referenceable_properties(element)
5220
5270
  properties = element.get('properties', {})
5221
- display_name = properties.get("displayName", "") or ""
5222
- description = properties.get("description", "") or ""
5223
- qualified_name = properties.get("qualifiedName", "") or ""
5271
+ props['properties'] = properties
5272
+
5273
+ classification_names = []
5274
+ for c in props['classifications']:
5275
+ classification_names.append(c.get("classificationName", None))
5276
+ props['classifications'] = classification_names
5277
+
5278
+ props['namespace'] = props['properties'].get("namespace", "") or ""
5224
5279
 
5225
- data_type = properties.get('dataType', "") or ""
5226
- match_property_names = properties.get('matchPropertyNames', []) or []
5227
- match_threshold = properties.get('matchThreshold', 0)
5228
- allow_duplicate_values = properties.get('allowDuplicateValues', False)
5229
- is_case_sensitive = properties.get('isCaseSensitive', False)
5230
- is_nullable = properties.get('isNullable', False)
5280
+ props['data_type'] = properties.get('dataType', "") or ""
5281
+ props['match_property_names'] = properties.get('matchPropertyNames', []) or []
5282
+ props['match_threshold'] = properties.get('matchThreshold', 0)
5283
+ props['allow_duplicate_values'] = properties.get('allowDuplicateValues', False)
5284
+ props['is_case_sensitive'] = properties.get('isCaseSensitive', False)
5285
+ props['is_nullable'] = properties.get('isNullable', False)
5231
5286
 
5232
- # Get data type from extendedProperties and additionalProperties if available
5233
- extended_properties = properties.get("extendedProperties", {})
5234
- additional_properties = properties.get("additionalProperties", {})
5235
5287
 
5236
5288
  # Now lets get the related elements
5237
5289
  associated_elements = self.get_data_rel_elements_dict(element)
5238
- data_dictionaries = associated_elements.get("member_of_data_dicts_qnames", [])
5239
- assigned_meanings = associated_elements.get("assigned_meanings_qnames", [])
5240
- parent_names = associated_elements.get("parent_qnames", [])
5241
- nested_data_classes = associated_elements.get("nested_data_class_qnames", [])
5242
- specialized_data_classes = associated_elements.get("specialized_data_class_qnames", [])
5243
- mermaid = element.get('mermaidGraph', "") or ""
5244
-
5245
- return {
5246
- 'GUID': guid,'display_name': display_name, 'qualified_name': qualified_name,'description': description,
5247
- 'assigned_meanings': assigned_meanings,
5248
- 'data_type': data_type, 'match_property_names': match_property_names,
5249
- 'match_threshold': match_threshold, 'allow_duplicate_values': allow_duplicate_values,
5250
- 'is_case_sensitive': is_case_sensitive, 'is_nullable': is_nullable,
5251
- 'properties': properties, 'parent_names': parent_names, 'nested_data_classes': nested_data_classes,
5252
- 'specialized_data_classes': specialized_data_classes,
5253
- 'extended_properties': extended_properties,
5254
- 'additional_properties': additional_properties, 'data_dictionaries': data_dictionaries,
5255
- 'mermaid': mermaid
5256
- }
5290
+ props['data_dictionaries'] = associated_elements.get("member_of_data_dicts_qnames", [])
5291
+ props['assigned_meanings'] = associated_elements.get("assigned_meanings_qnames", [])
5292
+ props['parent_names'] = associated_elements.get("parent_qnames", [])
5293
+ props['nested_data_classes'] = associated_elements.get("nested_data_class_qnames", [])
5294
+ props['specialized_data_classes'] = associated_elements.get("specialized_data_class_qnames", [])
5295
+ props['mermaid'] = element.get('mermaidGraph', "") or ""
5296
+
5297
+ return props
5257
5298
 
5258
5299
  def _extract_data_field_properties(self, element: dict) -> dict:
5259
5300
  """
@@ -5265,43 +5306,39 @@ r replace_all_properties: bool, default = False
5265
5306
  Returns:
5266
5307
  dict: Dictionary of extracted properties
5267
5308
  """
5268
- guid = element['elementHeader'].get("guid", None)
5309
+ props = _extract_referenceable_properties(element)
5310
+
5311
+ props['properties'] = element.get('properties', {})
5312
+ props['namespace'] = props['properties'].get("namespace", "") or ""
5269
5313
  properties = element.get('properties', {})
5270
- display_name = properties.get("displayName", "") or ""
5271
- description = properties.get("description", "") or ""
5272
- qualified_name = properties.get("qualifiedName", "") or ""
5273
-
5274
- is_nullable = properties.get('isNullable', False)
5275
- data_type = properties.get('dataType', "") or ""
5276
- minimum_length = properties.get('minimumLength', 0)
5277
- length = properties.get('length', 0)
5278
- precision = properties.get('precision', 0)
5279
- ordered_values = properties.get('orderedValues', False)
5280
- sort_order = properties.get('sortOrder', "") or ""
5281
-
5282
- # Get data type from extendedProperties and additionalProperties if available
5283
- extended_properties = properties.get("extendedProperties", {})
5284
- additional_properties = properties.get("additionalProperties", {})
5314
+
5315
+ classification_names = []
5316
+ for c in props['classifications']:
5317
+ classification_names.append(c.get("classificationName", None))
5318
+ props['classifications'] = classification_names
5319
+
5320
+ props['is_nullable'] = properties.get('isNullable', False)
5321
+ props['data_type'] = properties.get('dataType', "") or ""
5322
+ props['minimum_length'] = properties.get('minimumLength', 0)
5323
+ props['length'] = properties.get('length', 0)
5324
+ props['precision'] = properties.get('precision', 0)
5325
+ props['ordered_values'] = properties.get('orderedValues', False)
5326
+ props['sort_order'] = properties.get('sortOrder', "") or ""
5327
+
5285
5328
 
5286
5329
  # Now lets get the related elements
5287
5330
  associated_elements = self.get_data_rel_elements_dict(element)
5288
- data_dictionaries = associated_elements.get("member_of_data_dicts_qnames",[])
5289
- data_structures = associated_elements.get("data_structure_qnames",[])
5290
- assigned_meanings = associated_elements.get("assigned_meanings_qnames",[])
5291
- parent_names = associated_elements.get("parent_qnames",[])
5292
- data_class = associated_elements.get("data_class_qnames",[])
5293
- mermaid = element.get('mermaidGraph', "") or ""
5294
-
5295
- return {
5296
- 'GUID': guid,'display_name': display_name, 'qualified_name': qualified_name,'description': description,
5297
- 'assigned_meanings': assigned_meanings,
5298
- 'data_type': data_type, 'data_class': data_class, 'properties': properties,
5299
- 'is_nullable': is_nullable, 'minimum_length': minimum_length, 'length': length, 'precision': precision,
5300
- 'ordered_values': ordered_values, 'sort_order': sort_order, 'parent_names': parent_names, 'extended_properties': extended_properties,
5301
- 'additional_properties': additional_properties,'data_dictionaries': data_dictionaries, 'data_structures': data_structures, 'mermaid': mermaid
5302
- }
5331
+ props['data_dictionaries'] = associated_elements.get("member_of_data_dicts_qnames",[])
5332
+ props['data_structures'] = associated_elements.get("data_structure_qnames",[])
5333
+ props['assigned_meanings'] = associated_elements.get("assigned_meanings_qnames",[])
5334
+ props['parent_names'] = associated_elements.get("parent_qnames",[])
5335
+ props['data_class'] = associated_elements.get("data_class_qnames",[])
5336
+ props['mermaid'] = element.get('mermaidGraph', "") or ""
5337
+
5338
+ return props
5303
5339
 
5304
- def generate_basic_structured_output(self, elements, filter, output_format) -> str | list:
5340
+ def _generate_basic_structured_output(self, elements: dict, filter: str, output_format: str,
5341
+ columns_struct: dict = None) -> str | list:
5305
5342
  """
5306
5343
  Generate output in the specified format for the given elements.
5307
5344
 
@@ -5309,7 +5346,8 @@ r replace_all_properties: bool, default = False
5309
5346
  elements: Dictionary or list of dictionaries containing element data
5310
5347
  filter: The search string used to find the elements
5311
5348
  output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID, HTML)
5312
-
5349
+ columns_struct: dict, optional, default = None
5350
+ - The columns/attributes options to use
5313
5351
  Returns:
5314
5352
  Formatted output as string or list of dictionaries
5315
5353
  """
@@ -5323,6 +5361,7 @@ r replace_all_properties: bool, default = False
5323
5361
  elements=elements,
5324
5362
  search_string=filter,
5325
5363
  entity_type="Data Element",
5364
+ columns_struct=columns_struct,
5326
5365
  output_format="HTML",
5327
5366
  extract_properties_func=self._extract_data_structure_properties
5328
5367
  )
@@ -5330,17 +5369,19 @@ r replace_all_properties: bool, default = False
5330
5369
  # For other formats (MD, FORM, REPORT, LIST), use generate_output
5331
5370
  elif output_format in ["MD", "FORM", "REPORT", "LIST"]:
5332
5371
  # Define columns for LIST format
5333
- columns = [{'name': 'Name', 'key': 'display_name'}, {'name': 'Qualified Name', 'key': 'qualified_name'},
5334
- {'name': 'Description', 'key': 'description', 'format': True}]
5335
5372
 
5336
- return generate_output(elements=elements, search_string=filter, entity_type="Data Element",
5337
- output_format=output_format, extract_properties_func=self._extract_data_structure_properties,
5338
- columns=columns if output_format == 'LIST' else None)
5339
5373
 
5340
- # Default case
5341
- return None
5374
+ return generate_output(elements,
5375
+ filter,
5376
+ "Data Element",
5377
+ output_format,
5378
+ self._extract_data_structure_properties,
5379
+ None,
5380
+ columns_struct,
5381
+ )
5342
5382
 
5343
- def generate_data_structure_output(self, elements, filter, output_format) -> str | list:
5383
+
5384
+ def _generate_data_structure_output(self, elements, filter, output_format, columns_struct) -> str | list:
5344
5385
  """
5345
5386
  Generate output for data structures in the specified format.
5346
5387
 
@@ -5352,20 +5393,21 @@ r replace_all_properties: bool, default = False
5352
5393
  Returns:
5353
5394
  Formatted output as string or list of dictionaries
5354
5395
  """
5355
- if output_format in ["MD", "FORM", "REPORT", "LIST", "MERMAID", "HTML"]:
5356
- # Define columns for LIST format
5357
- columns = [{'name': 'Structure Name', 'key': 'display_name'},
5358
- {'name': 'Qualified Name', 'key': 'qualified_name','format': True}, {'name': 'Namespace', 'key': 'namespace'},
5359
- {'name': 'Version', 'key': 'version_identifier'},
5360
- {'name': 'Description', 'key': 'description', 'format': True}]
5361
-
5362
- return generate_output(elements=elements, search_string=filter, entity_type="Data Structure",
5363
- output_format=output_format, extract_properties_func=self._extract_data_structure_properties,
5364
- columns=columns if output_format == 'LIST' else None)
5365
- else:
5366
- return self.generate_basic_structured_output(elements, filter, output_format)
5396
+ entity_type = "Data Structure"
5397
+ if columns_struct is None:
5398
+ columns_struct = select_output_format_set(entity_type, output_format)
5399
+
5400
+
5401
+ return generate_output(elements,
5402
+ filter,
5403
+ entity_type,
5404
+ output_format,
5405
+ self._extract_data_structure_properties,
5406
+ None,
5407
+ columns_struct,
5408
+ )
5367
5409
 
5368
- def generate_data_class_output(self, elements, filter, output_format) -> str | list:
5410
+ def _generate_data_class_output(self, elements: dict, filter: str, output_format: str, columns_struct: dict = None) -> str | list:
5369
5411
  """
5370
5412
  Generate output for data classes in the specified format.
5371
5413
 
@@ -5373,23 +5415,26 @@ r replace_all_properties: bool, default = False
5373
5415
  elements: Dictionary or list of dictionaries containing data class elements
5374
5416
  filter: The search string used to find the elements
5375
5417
  output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID, HTML)
5376
-
5418
+ columns_struct: Optional columns structure
5419
+ - Option column/attribute selection and definition.
5377
5420
  Returns:
5378
- Formatted output as string or list of dictionaries
5421
+ Formatted output as either a string or list of dictionaries
5379
5422
  """
5380
- if output_format in ["DICT", "MD", "FORM", "REPORT", "LIST", "MERMAID", "HTML"]:
5381
- # Define columns for LIST format
5382
- columns = [{'name': 'Class Name', 'key': 'display_name'},
5383
- {'name': 'Qualified Name', 'key': 'qualified_name','format': True},
5384
- {'name': 'Description', 'key': 'description', 'format': True}]
5423
+ entity_type = "Data Class"
5424
+ if columns_struct is None:
5425
+ columns_struct = select_output_format_set(entity_type, output_format)
5385
5426
 
5386
- return generate_output(elements=elements, search_string=filter, entity_type="Data Class",
5387
- output_format=output_format, extract_properties_func=self._extract_data_class_properties,
5388
- columns=columns if output_format == 'LIST' else None)
5389
- else:
5390
- return self.generate_basic_structured_output(elements, filter, output_format)
5427
+ return generate_output(elements,
5428
+ filter,
5429
+ entity_type,
5430
+ output_format,
5431
+ self._extract_data_class_properties,
5432
+ None,
5433
+ columns_struct,
5434
+ )
5391
5435
 
5392
- def generate_data_field_output(self, elements, filter, output_format) -> str | list:
5436
+ def _generate_data_field_output(self, elements: dict, filter: str, output_format: str,
5437
+ columns_struct: dict = None) -> str | list:
5393
5438
  """
5394
5439
  Generate output for data fields in the specified format.
5395
5440
 
@@ -5397,21 +5442,24 @@ r replace_all_properties: bool, default = False
5397
5442
  elements: Dictionary or list of dictionaries containing data field elements
5398
5443
  filter: The search string used to find the elements
5399
5444
  output_format: The desired output format (MD, FORM, REPORT, LIST, DICT, MERMAID, HTML)
5445
+ columns_struct: dict, Optional, default = None
5446
+ - Option column/attribute selection and definition.
5400
5447
 
5401
5448
  Returns:
5402
5449
  Formatted output as a string or list of dictionaries
5403
5450
  """
5404
- if output_format in ["MD", "FORM", "REPORT", "LIST", "DICT", "MERMAID", "HTML"]:
5405
- # Define columns for LIST format
5406
- columns = [{'name': 'Field Name', 'key': 'display_name'},
5407
- {'name': 'Qualified Name', 'key': 'qualified_name','format': True}, {'name': 'Data Type', 'key': 'data_type'},
5408
- {'name': 'Description', 'key': 'description', 'format': True}]
5409
-
5410
- return generate_output(elements=elements, search_string=filter, entity_type="Data Field",
5411
- output_format=output_format, extract_properties_func=self._extract_data_field_properties,
5412
- columns=columns if output_format == 'LIST' else None)
5413
- else:
5414
- return self.generate_basic_structured_output(elements, filter, output_format)
5451
+ entity_type = "Data Field"
5452
+ if columns_struct is None:
5453
+ columns_struct = select_output_format_set(entity_type, output_format)
5454
+
5455
+ return generate_output(elements,
5456
+ filter,
5457
+ entity_type,
5458
+ output_format,
5459
+ self._extract_data_field_properties,
5460
+ None,
5461
+ columns_struct,
5462
+ )
5415
5463
 
5416
5464
 
5417
5465