pyegeria 5.4.0.14__py3-none-any.whl → 5.4.0.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- commands/cat/.DS_Store +0 -0
- commands/cat/.env +8 -0
- commands/cat/debug_log +550 -0
- commands/cat/debug_log.log +0 -0
- commands/cat/list_format_set.py +10 -4
- commands/cat/logs/pyegeria.log +0 -0
- commands/cli/debug_log.log +0 -0
- commands/ops/load_archive.py +26 -22
- commands/ops/logs/pyegeria.log +0 -0
- md_processing/.DS_Store +0 -0
- md_processing/dr_egeria_inbox/Derive-Dr-Gov-Defs.md +8 -0
- md_processing/dr_egeria_inbox/Dr.Egeria Templates.md +873 -0
- md_processing/dr_egeria_inbox/arch_test.md +57 -0
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro.md +254 -0
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_more_terms.md +696 -0
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part1.md +254 -0
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part2.md +298 -0
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part3.md +608 -0
- md_processing/dr_egeria_inbox/archive/dr_egeria_intro_part4.md +94 -0
- md_processing/dr_egeria_inbox/archive/freddie_intro.md +284 -0
- md_processing/dr_egeria_inbox/archive/freddie_intro_orig.md +275 -0
- md_processing/dr_egeria_inbox/archive/test-term.md +110 -0
- md_processing/dr_egeria_inbox/cat_test.md +100 -0
- md_processing/dr_egeria_inbox/collections.md +39 -0
- md_processing/dr_egeria_inbox/data_designer_debug.log +6 -0
- md_processing/dr_egeria_inbox/data_designer_out.md +60 -0
- md_processing/dr_egeria_inbox/data_designer_search_test.md +11 -0
- md_processing/dr_egeria_inbox/data_field.md +54 -0
- md_processing/dr_egeria_inbox/data_spec.md +77 -0
- md_processing/dr_egeria_inbox/data_spec_test.md +2406 -0
- md_processing/dr_egeria_inbox/data_test.md +179 -0
- md_processing/dr_egeria_inbox/data_test2.md +429 -0
- md_processing/dr_egeria_inbox/data_test3.md +462 -0
- md_processing/dr_egeria_inbox/dr_egeria_data_designer_1.md +124 -0
- md_processing/dr_egeria_inbox/dr_egeria_intro_categories.md +168 -0
- md_processing/dr_egeria_inbox/dr_egeria_intro_part1.md +280 -0
- md_processing/dr_egeria_inbox/dr_egeria_intro_part2.md +313 -0
- md_processing/dr_egeria_inbox/dr_egeria_intro_part3.md +1073 -0
- md_processing/dr_egeria_inbox/dr_egeria_isc1.md +44 -0
- md_processing/dr_egeria_inbox/generated_help_report.md +9 -0
- md_processing/dr_egeria_inbox/glossary_list.md +5 -0
- md_processing/dr_egeria_inbox/glossary_search_test.md +40 -0
- md_processing/dr_egeria_inbox/glossary_test1.md +324 -0
- md_processing/dr_egeria_inbox/gov_def.md +424 -0
- md_processing/dr_egeria_inbox/gov_def2.md +447 -0
- md_processing/dr_egeria_inbox/product.md +50 -0
- md_processing/dr_egeria_inbox/rel.md +8 -0
- md_processing/dr_egeria_inbox/sb.md +119 -0
- md_processing/dr_egeria_inbox/solution-components.md +136 -0
- md_processing/dr_egeria_inbox/solution_blueprints.md +118 -0
- md_processing/dr_egeria_inbox/synonym_test.md +42 -0
- md_processing/dr_egeria_inbox/t2.md +268 -0
- md_processing/dr_egeria_outbox/.obsidian/app.json +1 -0
- md_processing/dr_egeria_outbox/.obsidian/appearance.json +1 -0
- md_processing/dr_egeria_outbox/.obsidian/community-plugins.json +6 -0
- md_processing/dr_egeria_outbox/.obsidian/core-plugins.json +31 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/data.json +10 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/main.js +4459 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/calendar/manifest.json +10 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/data.json +3 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/main.js +153 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/manifest.json +11 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-kanban/styles.css +1 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/main.js +500 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +12 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/obsidian-tasks-plugin/styles.css +1 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/main.js +37 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/manifest.json +11 -0
- md_processing/dr_egeria_outbox/.obsidian/plugins/templater-obsidian/styles.css +220 -0
- md_processing/dr_egeria_outbox/.obsidian/types.json +28 -0
- md_processing/dr_egeria_outbox/.obsidian/workspace.json +220 -0
- md_processing/dr_egeria_outbox/Untitled.canvas +1 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-07-18 15:00-product.md +62 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-07-18 15:13-product.md +62 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-07-20 13:23-product.md +47 -0
- md_processing/dr_egeria_outbox/friday/processed-2025-08-01 11:55-data_test3.md +503 -0
- md_processing/dr_egeria_outbox/monday/processed-2025-07-14 12:38-data_designer_out.md +663 -0
- md_processing/dr_egeria_outbox/monday/processed-2025-07-21 10:52-generated_help_report.md +2744 -0
- md_processing/dr_egeria_outbox/monday/processed-2025-07-21 18:38-collections.md +62 -0
- md_processing/dr_egeria_outbox/monday/processed-2025-08-01 11:34-gov_def.md +444 -0
- md_processing/dr_egeria_outbox/processed-2025-08-03 16:05-glossary_list.md +37 -0
- md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 14:55-product.md +77 -0
- md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 15:05-product.md +75 -0
- md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 15:11-product.md +74 -0
- md_processing/dr_egeria_outbox/sunday/processed-2025-07-20 20:40-collections.md +49 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 15:00-Derive-Dr-Gov-Defs.md +719 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:13-Derive-Dr-Gov-Defs.md +41 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:14-Derive-Dr-Gov-Defs.md +33 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 20:50-Derive-Dr-Gov-Defs.md +192 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 22:08-gov_def2.md +486 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-17 22:10-gov_def2.md +486 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 08:53-gov_def2.md +486 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 08:54-gov_def2.md +486 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:03-gov_def2.md +486 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:06-gov_def2.md +486 -0
- md_processing/dr_egeria_outbox/thursday/processed-2025-07-18 09:10-gov_def2.md +486 -0
- md_processing/dr_egeria_outbox/tuesday/processed-2025-07-16 19:15-gov_def2.md +527 -0
- md_processing/dr_egeria_outbox/tuesday/processed-2025-07-17 12:08-gov_def2.md +527 -0
- md_processing/dr_egeria_outbox/tuesday/processed-2025-07-17 14:27-gov_def2.md +485 -0
- md_processing/md_processing_utils/debug_log.log +0 -0
- md_processing/md_processing_utils/solution_architect_log.log +0 -0
- pyegeria/.DS_Store +0 -0
- pyegeria/_client_new.py +31 -1
- pyegeria/_output_format_models.py +373 -0
- pyegeria/_output_formats.py +501 -190
- pyegeria/collection_manager_omvs.py +1 -1
- pyegeria/glossary_browser_omvs.py +178 -65
- pyegeria/governance_officer_omvs.py +2 -2
- pyegeria/load_config.py +38 -13
- pyegeria/logging_configuration.py +2 -2
- {pyegeria-5.4.0.14.dist-info → pyegeria-5.4.0.16.dist-info}/METADATA +1 -1
- {pyegeria-5.4.0.14.dist-info → pyegeria-5.4.0.16.dist-info}/RECORD +115 -17
- md_processing/dr-egeria-outbox/DataStruct-2025-07-29-20-49-16.py +0 -8
- md_processing/dr-egeria-outbox/Mandy-DataStruct-2025-07-29-15-54-45.md +0 -19
- pyegeria/dr.egeria spec.md +0 -9
- {pyegeria-5.4.0.14.dist-info → pyegeria-5.4.0.16.dist-info}/LICENSE +0 -0
- {pyegeria-5.4.0.14.dist-info → pyegeria-5.4.0.16.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.0.14.dist-info → pyegeria-5.4.0.16.dist-info}/entry_points.txt +0 -0
@@ -16,6 +16,7 @@ from pyegeria._exceptions import InvalidParameterException, PropertyServerExcept
|
|
16
16
|
from pyegeria._globals import NO_CATEGORIES_FOUND, NO_TERMS_FOUND
|
17
17
|
from pyegeria._validators import validate_guid, validate_name, validate_search_string
|
18
18
|
from pyegeria.utils import body_slimmer
|
19
|
+
from pyegeria._output_formats import select_output_format_set, get_output_format_type_match
|
19
20
|
from pyegeria.output_formatter import (
|
20
21
|
make_preamble,
|
21
22
|
make_md_attribute,
|
@@ -255,7 +256,7 @@ class GlossaryBrowser(Client):
|
|
255
256
|
return self._extract_glossary_properties(element, self._current_output_format)
|
256
257
|
|
257
258
|
def generate_glossaries_md(self, elements: list | dict, search_string: str,
|
258
|
-
output_format: str = 'MD') -> str | list:
|
259
|
+
output_format: str = 'MD', output_format_set: str | dict = None) -> str | list:
|
259
260
|
"""
|
260
261
|
Generate markdown or dictionary representation of glossaries.
|
261
262
|
|
@@ -263,6 +264,7 @@ class GlossaryBrowser(Client):
|
|
263
264
|
elements (list | dict): List or dictionary of glossary elements
|
264
265
|
search_string (str): The search string used
|
265
266
|
output_format (str): Output format (MD, FORM, REPORT, LIST, DICT)
|
267
|
+
output_format_set (str | dict, optional): Output format set name or dictionary. Defaults to None.
|
266
268
|
|
267
269
|
Returns:
|
268
270
|
str | list: Markdown string or list of dictionaries depending on output_format
|
@@ -270,8 +272,8 @@ class GlossaryBrowser(Client):
|
|
270
272
|
# Store the current output format for use by _extract_glossary_properties_with_format
|
271
273
|
self._current_output_format = output_format
|
272
274
|
|
273
|
-
# Define columns for LIST format
|
274
|
-
|
275
|
+
# Define default columns for LIST format
|
276
|
+
default_columns = [
|
275
277
|
{'name': 'Glossary Name', 'key': 'display_name'},
|
276
278
|
{'name': 'Qualified Name', 'key': 'qualified_name'},
|
277
279
|
{'name': 'Language', 'key': 'language', 'format': True},
|
@@ -280,13 +282,27 @@ class GlossaryBrowser(Client):
|
|
280
282
|
{'name': 'Categories', 'key': 'categories_names', 'format': True},
|
281
283
|
]
|
282
284
|
|
285
|
+
# Determine the output format set
|
286
|
+
output_formats = None
|
287
|
+
if output_format_set:
|
288
|
+
if isinstance(output_format_set, str):
|
289
|
+
output_formats = select_output_format_set(output_format_set, output_format)
|
290
|
+
elif isinstance(output_format_set, dict):
|
291
|
+
output_formats = get_output_format_type_match(output_format_set, output_format)
|
292
|
+
else:
|
293
|
+
# Use default entity type to lookup the output format
|
294
|
+
output_formats = select_output_format_set("Glossary", output_format)
|
295
|
+
# If no format set is found, create one with default columns
|
296
|
+
if not output_formats and output_format == 'LIST':
|
297
|
+
output_formats = {"formats": {"columns": default_columns}}
|
298
|
+
|
283
299
|
return generate_output(
|
284
300
|
elements=elements,
|
285
301
|
search_string=search_string,
|
286
302
|
entity_type="Glossary",
|
287
303
|
output_format=output_format,
|
288
304
|
extract_properties_func=self._extract_glossary_properties_with_format,
|
289
|
-
|
305
|
+
columns_struct=output_formats
|
290
306
|
)
|
291
307
|
|
292
308
|
def _extract_term_properties(self, element: dict) -> dict:
|
@@ -488,7 +504,7 @@ class GlossaryBrowser(Client):
|
|
488
504
|
entity_type="Term", extract_properties_func=self._extract_term_properties,
|
489
505
|
get_additional_props_func=self._get_term_additional_properties)
|
490
506
|
|
491
|
-
def generate_terms_md(self, elements: list | dict, search_string: str, output_format: str = 'MD') -> str | list:
|
507
|
+
def generate_terms_md(self, elements: list | dict, search_string: str, output_format: str = 'MD', output_format_set: str | dict = None) -> str | list:
|
492
508
|
"""
|
493
509
|
Generate markdown or dictionary representation of terms.
|
494
510
|
|
@@ -496,12 +512,13 @@ class GlossaryBrowser(Client):
|
|
496
512
|
elements (list | dict): List or dictionary of term elements
|
497
513
|
search_string (str): The search string used
|
498
514
|
output_format (str): Output format (MD, MD-TABLE, DICT, FORM, REPORT)
|
515
|
+
output_format_set (str | dict, optional): Output format set name or dictionary. Defaults to None.
|
499
516
|
|
500
517
|
Returns:
|
501
518
|
str | list: Markdown string or list of dictionaries depending on output_format
|
502
519
|
"""
|
503
|
-
# Define columns for LIST format
|
504
|
-
|
520
|
+
# Define default columns for LIST format
|
521
|
+
default_columns = [
|
505
522
|
{'name': 'Term Name', 'key': 'display_name'},
|
506
523
|
{'name': 'Qualified Name', 'key': 'qualified_name'},
|
507
524
|
{'name': 'Summary', 'key': 'summary', 'format': True},
|
@@ -511,6 +528,20 @@ class GlossaryBrowser(Client):
|
|
511
528
|
{'name': 'Glossary', 'key': 'glossary_name'},
|
512
529
|
]
|
513
530
|
|
531
|
+
# Determine the output format set
|
532
|
+
output_formats = None
|
533
|
+
if output_format_set:
|
534
|
+
if isinstance(output_format_set, str):
|
535
|
+
output_formats = select_output_format_set(output_format_set, output_format)
|
536
|
+
elif isinstance(output_format_set, dict):
|
537
|
+
output_formats = get_output_format_type_match(output_format_set, output_format)
|
538
|
+
else:
|
539
|
+
# Use default entity type to lookup the output format
|
540
|
+
output_formats = select_output_format_set("Term", output_format)
|
541
|
+
# If no format set is found, create one with default columns
|
542
|
+
if not output_formats and output_format == 'LIST':
|
543
|
+
output_formats = {"formats": {"columns": default_columns}}
|
544
|
+
|
514
545
|
return generate_output(
|
515
546
|
elements=elements,
|
516
547
|
search_string=search_string,
|
@@ -518,7 +549,7 @@ class GlossaryBrowser(Client):
|
|
518
549
|
output_format=output_format,
|
519
550
|
extract_properties_func=self._extract_term_properties,
|
520
551
|
get_additional_props_func=self._get_term_additional_properties,
|
521
|
-
|
552
|
+
columns_struct=output_formats
|
522
553
|
)
|
523
554
|
|
524
555
|
def _get_parent_category_name(self, category_guid: str, output_format: str = None) -> str:
|
@@ -778,7 +809,7 @@ class GlossaryBrowser(Client):
|
|
778
809
|
get_additional_props_func=get_additional_props_with_format)
|
779
810
|
|
780
811
|
def generate_categories_md(self, elements: list | dict, search_string: str,
|
781
|
-
output_format: str = 'MD') -> str | list:
|
812
|
+
output_format: str = 'MD', output_format_set: str | dict = None) -> str | list:
|
782
813
|
"""
|
783
814
|
Generate markdown or dictionary representation of categories.
|
784
815
|
|
@@ -786,12 +817,13 @@ class GlossaryBrowser(Client):
|
|
786
817
|
elements (list | dict): List or dictionary of category elements
|
787
818
|
search_string (str): The search string used
|
788
819
|
output_format (str): Output format (MD, LIST, DICT, FORM, REPORT)
|
820
|
+
output_format_set (str | dict, optional): Output format set name or dictionary. Defaults to None.
|
789
821
|
|
790
822
|
Returns:
|
791
823
|
str | list: Markdown string or list of dictionaries depending on output_format
|
792
824
|
"""
|
793
|
-
# Define columns for LIST format
|
794
|
-
|
825
|
+
# Define default columns for LIST format
|
826
|
+
default_columns = [
|
795
827
|
{'name': 'Category Name', 'key': 'display_name'},
|
796
828
|
{'name': 'Qualified Name', 'key': 'qualified_name'},
|
797
829
|
{'name': 'Description', 'key': 'description', 'format': True},
|
@@ -800,6 +832,20 @@ class GlossaryBrowser(Client):
|
|
800
832
|
{'name': 'Glossary', 'key': 'glossary_name'},
|
801
833
|
]
|
802
834
|
|
835
|
+
# Determine the output format set
|
836
|
+
output_formats = None
|
837
|
+
if output_format_set:
|
838
|
+
if isinstance(output_format_set, str):
|
839
|
+
output_formats = select_output_format_set(output_format_set, output_format)
|
840
|
+
elif isinstance(output_format_set, dict):
|
841
|
+
output_formats = get_output_format_type_match(output_format_set, output_format)
|
842
|
+
else:
|
843
|
+
# Use default entity type to lookup the output format
|
844
|
+
output_formats = select_output_format_set("Category", output_format)
|
845
|
+
# If no format set is found, create one with default columns
|
846
|
+
if not output_formats and output_format == 'LIST':
|
847
|
+
output_formats = {"formats": {"columns": default_columns}}
|
848
|
+
|
803
849
|
# Create a wrapper function to pass output_format to _get_category_additional_properties
|
804
850
|
def get_additional_props_with_format(element, category_guid, output_format_param=None):
|
805
851
|
return self._get_category_additional_properties(element, category_guid, output_format)
|
@@ -811,7 +857,7 @@ class GlossaryBrowser(Client):
|
|
811
857
|
output_format=output_format,
|
812
858
|
extract_properties_func=self._extract_category_properties,
|
813
859
|
get_additional_props_func=get_additional_props_with_format,
|
814
|
-
|
860
|
+
columns_struct=output_formats
|
815
861
|
)
|
816
862
|
|
817
863
|
#
|
@@ -977,7 +1023,7 @@ class GlossaryBrowser(Client):
|
|
977
1023
|
async def _async_find_glossaries(self, search_string: str, effective_time: str = None, starts_with: bool = False,
|
978
1024
|
ends_with: bool = False, ignore_case: bool = False, for_lineage: bool = False,
|
979
1025
|
for_duplicate_processing: bool = False, type_name: str = None, start_from: int = 0,
|
980
|
-
page_size: int = None, output_format: str = 'JSON') -> list | str:
|
1026
|
+
page_size: int = None, output_format: str = 'JSON', output_format_set: str | dict = None) -> list | str:
|
981
1027
|
"""Retrieve the list of glossary metadata elements that contain the search string. Async version.
|
982
1028
|
The search string is located in the request body and is interpreted as a plain string.
|
983
1029
|
The request parameters, startsWith, endsWith, and ignoreCase can be used to allow a fuzzy search.
|
@@ -1015,6 +1061,8 @@ class GlossaryBrowser(Client):
|
|
1015
1061
|
MD - output standard markdown with no preamble
|
1016
1062
|
FORM - output markdown with a preamble for a form
|
1017
1063
|
REPORT - output markdown with a preamble for a report
|
1064
|
+
output_format_set: str | dict, optional
|
1065
|
+
Output format set name or dictionary. Defaults to None.
|
1018
1066
|
|
1019
1067
|
Returns
|
1020
1068
|
-------
|
@@ -1068,13 +1116,13 @@ class GlossaryBrowser(Client):
|
|
1068
1116
|
return None
|
1069
1117
|
|
1070
1118
|
if output_format != 'JSON': # return a simplified markdown representation
|
1071
|
-
return self.generate_glossaries_md(element, search_string, output_format)
|
1119
|
+
return self.generate_glossaries_md(element, search_string, output_format, output_format_set)
|
1072
1120
|
return response.json().get("elementList", NO_GLOSSARIES_FOUND)
|
1073
1121
|
|
1074
1122
|
def find_glossaries(self, search_string: str, effective_time: str = None, starts_with: bool = False,
|
1075
1123
|
ends_with: bool = False, ignore_case: bool = False, for_lineage: bool = False,
|
1076
1124
|
for_duplicate_processing: bool = False, type_name: str = None, start_from: int = 0,
|
1077
|
-
page_size: int = None, output_format: str = "JSON") -> list | str:
|
1125
|
+
page_size: int = None, output_format: str = "JSON", output_format_set: str | dict = None) -> list | str:
|
1078
1126
|
"""Retrieve the list of glossary metadata elements that contain the search string.
|
1079
1127
|
The search string is located in the request body and is interpreted as a plain string.
|
1080
1128
|
The request parameters, startsWith, endsWith, and ignoreCase can be used to allow a fuzzy search.
|
@@ -1116,6 +1164,8 @@ class GlossaryBrowser(Client):
|
|
1116
1164
|
LIST - output a markdown table with columns for Glossary Name, Qualified Name, Language, Description,
|
1117
1165
|
Usage
|
1118
1166
|
DICT - output a dictionary structure containing all attributes
|
1167
|
+
output_format_set: str | dict, optional
|
1168
|
+
Output format set name or dictionary. Defaults to None.
|
1119
1169
|
Returns
|
1120
1170
|
-------
|
1121
1171
|
List | str
|
@@ -1136,12 +1186,12 @@ class GlossaryBrowser(Client):
|
|
1136
1186
|
loop = asyncio.get_event_loop()
|
1137
1187
|
response = loop.run_until_complete(
|
1138
1188
|
self._async_find_glossaries(search_string, effective_time, starts_with, ends_with, ignore_case, for_lineage,
|
1139
|
-
for_duplicate_processing, type_name, start_from, page_size, output_format))
|
1189
|
+
for_duplicate_processing, type_name, start_from, page_size, output_format, output_format_set))
|
1140
1190
|
|
1141
1191
|
return response
|
1142
1192
|
|
1143
1193
|
async def _async_get_glossary_by_guid(self, glossary_guid: str, effective_time: str = None,
|
1144
|
-
output_format: str = "JSON") -> dict | str:
|
1194
|
+
output_format: str = "JSON", output_format_set: str | dict = None) -> dict | str:
|
1145
1195
|
"""Retrieves information about a glossary
|
1146
1196
|
Parameters
|
1147
1197
|
----------
|
@@ -1159,6 +1209,8 @@ class GlossaryBrowser(Client):
|
|
1159
1209
|
LIST - output a markdown table with columns for Glossary Name, Qualified Name, Language, Description,
|
1160
1210
|
Usage
|
1161
1211
|
DICT - output a dictionary structure containing all attributes
|
1212
|
+
output_format_set: str | dict, optional
|
1213
|
+
Output format set name or dictionary. Defaults to None.
|
1162
1214
|
|
1163
1215
|
Returns
|
1164
1216
|
-------
|
@@ -1189,10 +1241,10 @@ class GlossaryBrowser(Client):
|
|
1189
1241
|
if element == NO_GLOSSARIES_FOUND:
|
1190
1242
|
return NO_GLOSSARIES_FOUND
|
1191
1243
|
if output_format != 'JSON': # return a simplified markdown representation
|
1192
|
-
return self.generate_glossaries_md(element, "GUID", output_format)
|
1244
|
+
return self.generate_glossaries_md(element, "GUID", output_format, output_format_set)
|
1193
1245
|
return response.json().get("element", NO_GLOSSARIES_FOUND)
|
1194
1246
|
|
1195
|
-
def get_glossary_by_guid(self, glossary_guid: str, effective_time: str = None, output_format: str = "JSON") -> dict:
|
1247
|
+
def get_glossary_by_guid(self, glossary_guid: str, effective_time: str = None, output_format: str = "JSON", output_format_set: str | dict = None) -> dict:
|
1196
1248
|
"""Retrieves information about a glossary
|
1197
1249
|
Parameters
|
1198
1250
|
----------
|
@@ -1210,6 +1262,8 @@ class GlossaryBrowser(Client):
|
|
1210
1262
|
LIST - output a markdown table with columns for Glossary Name, Qualified Name, Language, Description,
|
1211
1263
|
Usage
|
1212
1264
|
DICT - output a dictionary structure containing all attributes
|
1265
|
+
output_format_set: str | dict, optional
|
1266
|
+
Output format set name or dictionary. Defaults to None.
|
1213
1267
|
|
1214
1268
|
Returns
|
1215
1269
|
-------
|
@@ -1229,7 +1283,7 @@ class GlossaryBrowser(Client):
|
|
1229
1283
|
"""
|
1230
1284
|
loop = asyncio.get_event_loop()
|
1231
1285
|
response = loop.run_until_complete(
|
1232
|
-
self._async_get_glossary_by_guid(glossary_guid, effective_time, output_format))
|
1286
|
+
self._async_get_glossary_by_guid(glossary_guid, effective_time, output_format, output_format_set))
|
1233
1287
|
return response
|
1234
1288
|
|
1235
1289
|
async def _async_get_glossaries_by_name(self, glossary_name: str, effective_time: str = None, start_from: int = 0,
|
@@ -1516,7 +1570,7 @@ class GlossaryBrowser(Client):
|
|
1516
1570
|
async def _async_find_glossary_categories(self, search_string: str, effective_time: str = None,
|
1517
1571
|
starts_with: bool = False, ends_with: bool = False,
|
1518
1572
|
ignore_case: bool = False, start_from: int = 0, page_size: int = None,
|
1519
|
-
output_format: str = "JSON") -> list | str:
|
1573
|
+
output_format: str = "JSON", output_format_set: str | dict = None) -> list | str:
|
1520
1574
|
"""Retrieve the list of glossary category metadata elements that contain the search string.
|
1521
1575
|
The search string is located in the request body and is interpreted as a plain string.
|
1522
1576
|
The request parameters, startsWith, endsWith, and ignoreCase can be used to allow a fuzzy search.
|
@@ -1549,6 +1603,8 @@ class GlossaryBrowser(Client):
|
|
1549
1603
|
MD - output standard markdown with no preamble
|
1550
1604
|
FORM - output markdown with a preamble for a form
|
1551
1605
|
REPORT - output markdown with a preamble for a report
|
1606
|
+
output_format_set: str | dict, optional
|
1607
|
+
Output format set name or dictionary. Defaults to None.
|
1552
1608
|
|
1553
1609
|
Returns
|
1554
1610
|
-------
|
@@ -1596,12 +1652,12 @@ class GlossaryBrowser(Client):
|
|
1596
1652
|
elif output_format == 'DICT':
|
1597
1653
|
return None
|
1598
1654
|
if output_format != 'JSON': # return a simplified markdown representation
|
1599
|
-
return self.generate_categories_md(element, search_string, output_format)
|
1655
|
+
return self.generate_categories_md(element, search_string, output_format, output_format_set)
|
1600
1656
|
return response.json().get("elementList", NO_CATEGORIES_FOUND)
|
1601
1657
|
|
1602
1658
|
def find_glossary_categories(self, search_string: str, effective_time: str = None, starts_with: bool = False,
|
1603
1659
|
ends_with: bool = False, ignore_case: bool = False, start_from: int = 0,
|
1604
|
-
page_size: int = None, output_format: str = "JSON") -> list | str:
|
1660
|
+
page_size: int = None, output_format: str = "JSON", output_format_set: str | dict = None) -> list | str:
|
1605
1661
|
"""Retrieve the list of glossary category metadata elements that contain the search string.
|
1606
1662
|
The search string is located in the request body and is interpreted as a plain string.
|
1607
1663
|
The request parameters, startsWith, endsWith, and ignoreCase can be used to allow a fuzzy search.
|
@@ -1624,16 +1680,18 @@ class GlossaryBrowser(Client):
|
|
1624
1680
|
ignore_case : bool, [default=False], optional
|
1625
1681
|
Ignore case when searching
|
1626
1682
|
start_from: int, [default=0], optional
|
1627
|
-
|
1628
|
-
|
1629
|
-
|
1630
|
-
|
1683
|
+
When multiple pages of results are available, the page number to start from.
|
1684
|
+
page_size: int, [default=None]
|
1685
|
+
The number of items to return in a single page. If not specified, the default will be taken from
|
1686
|
+
the class instance.
|
1631
1687
|
output_format: str, default = 'JSON'
|
1632
1688
|
Type of output to produce:
|
1633
1689
|
JSON - output standard json
|
1634
1690
|
MD - output standard markdown with no preamble
|
1635
1691
|
FORM - output markdown with a preamble for a form
|
1636
1692
|
REPORT - output markdown with a preamble for a report
|
1693
|
+
output_format_set: str | dict, optional
|
1694
|
+
Output format set name or dictionary. Defaults to None.
|
1637
1695
|
|
1638
1696
|
Returns
|
1639
1697
|
-------
|
@@ -1655,7 +1713,7 @@ class GlossaryBrowser(Client):
|
|
1655
1713
|
loop = asyncio.get_event_loop()
|
1656
1714
|
response = loop.run_until_complete(
|
1657
1715
|
self._async_find_glossary_categories(search_string, effective_time, starts_with, ends_with, ignore_case,
|
1658
|
-
start_from, page_size, output_format))
|
1716
|
+
start_from, page_size, output_format, output_format_set))
|
1659
1717
|
|
1660
1718
|
return response
|
1661
1719
|
|
@@ -1912,7 +1970,7 @@ class GlossaryBrowser(Client):
|
|
1912
1970
|
return response
|
1913
1971
|
|
1914
1972
|
async def _async_get_category_by_guid(self, glossary_category_guid: str, effective_time: str = None,
|
1915
|
-
output_format: str = 'JSON', ) -> list | str:
|
1973
|
+
output_format: str = 'JSON', output_format_set: str | dict = None) -> list | str:
|
1916
1974
|
"""Retrieve the requested glossary category metadata element. The optional request body contain an effective
|
1917
1975
|
time for the query..
|
1918
1976
|
|
@@ -1932,6 +1990,8 @@ class GlossaryBrowser(Client):
|
|
1932
1990
|
MD - output standard markdown with no preamble
|
1933
1991
|
FORM - output markdown with a preamble for a form
|
1934
1992
|
REPORT - output markdown with a preamble for a report
|
1993
|
+
output_format_set: str | dict, optional
|
1994
|
+
Output format set name or dictionary. Defaults to None.
|
1935
1995
|
|
1936
1996
|
Returns
|
1937
1997
|
-------
|
@@ -1964,11 +2024,11 @@ class GlossaryBrowser(Client):
|
|
1964
2024
|
if element == NO_CATEGORIES_FOUND:
|
1965
2025
|
return NO_CATEGORIES_FOUND
|
1966
2026
|
if output_format != 'JSON': # return a simplified markdown representation
|
1967
|
-
return self.generate_categories_md(element, "GUID", output_format)
|
2027
|
+
return self.generate_categories_md(element, "GUID", output_format, output_format_set)
|
1968
2028
|
return response.json().get("element", NO_CATEGORIES_FOUND)
|
1969
2029
|
|
1970
2030
|
def get_category_by_guid(self, glossary_category_guid: str, effective_time: str = None,
|
1971
|
-
output_format: str = 'JSON', ) -> list | str:
|
2031
|
+
output_format: str = 'JSON', output_format_set: str | dict = None) -> list | str:
|
1972
2032
|
"""Retrieve the requested glossary category metadata element. The optional request body contain an effective
|
1973
2033
|
time for the query..
|
1974
2034
|
|
@@ -1986,6 +2046,8 @@ class GlossaryBrowser(Client):
|
|
1986
2046
|
MD - output standard markdown with no preamble
|
1987
2047
|
FORM - output markdown with a preamble for a form
|
1988
2048
|
REPORT - output markdown with a preamble for a report
|
2049
|
+
output_format_set: str | dict, optional
|
2050
|
+
Output format set name or dictionary. Defaults to None.
|
1989
2051
|
|
1990
2052
|
Returns
|
1991
2053
|
-------
|
@@ -2093,7 +2155,7 @@ class GlossaryBrowser(Client):
|
|
2093
2155
|
response = loop.run_until_complete(self._async_get_category_parent(glossary_category_guid, effective_time))
|
2094
2156
|
return response
|
2095
2157
|
|
2096
|
-
def get_glossary_category_structure(self, glossary_guid: str, output_format: str = "DICT") -> dict | str:
|
2158
|
+
def get_glossary_category_structure(self, glossary_guid: str, output_format: str = "DICT", output_format_set: str | dict = None) -> dict | str:
|
2097
2159
|
"""Derive the category structure of an Egeria glossary.
|
2098
2160
|
|
2099
2161
|
This method builds a hierarchical representation of the categories in a glossary,
|
@@ -2108,6 +2170,8 @@ class GlossaryBrowser(Client):
|
|
2108
2170
|
- DICT: Returns a Python dictionary structure
|
2109
2171
|
- LIST: Returns a markdown table
|
2110
2172
|
- MD: Returns a markdown outline with bullets and indentations
|
2173
|
+
output_format_set: str | dict, optional
|
2174
|
+
Output format set name or dictionary. Defaults to None.
|
2111
2175
|
|
2112
2176
|
Returns
|
2113
2177
|
-------
|
@@ -2529,7 +2593,7 @@ class GlossaryBrowser(Client):
|
|
2529
2593
|
|
2530
2594
|
return response
|
2531
2595
|
|
2532
|
-
def generate_related_terms_md(self, term_elements: list, term_guid: str, output_format: str = 'MD') -> str | list:
|
2596
|
+
def generate_related_terms_md(self, term_elements: list, term_guid: str, output_format: str = 'MD', output_format_set: str | dict = None) -> str | list:
|
2533
2597
|
"""
|
2534
2598
|
Generate a simplified representation of related terms.
|
2535
2599
|
|
@@ -2537,6 +2601,7 @@ class GlossaryBrowser(Client):
|
|
2537
2601
|
term_elements (list): List of term elements with relationship information
|
2538
2602
|
term_guid (str): GUID of the term for which to generate related terms
|
2539
2603
|
output_format (str): Output format (MD, LIST, DICT, etc.)
|
2604
|
+
output_format_set (str | dict, optional): Output format set name or dictionary. Defaults to None.
|
2540
2605
|
|
2541
2606
|
Returns:
|
2542
2607
|
str | list: Markdown string or list of dictionaries depending on output_format
|
@@ -2572,6 +2637,26 @@ class GlossaryBrowser(Client):
|
|
2572
2637
|
|
2573
2638
|
related_terms.append(related_term)
|
2574
2639
|
|
2640
|
+
# Define default columns for LIST format
|
2641
|
+
default_columns = [
|
2642
|
+
{'name': 'First Term', 'key': 'first_term_display_name'},
|
2643
|
+
{'name': 'First Term Qualified Name', 'key': 'first_term_qualified_name'},
|
2644
|
+
{'name': 'Related Term', 'key': 'related_term_display_name'},
|
2645
|
+
{'name': 'Related Term Qualified Name', 'key': 'related_term_qualified_name'},
|
2646
|
+
{'name': 'Relationship Type', 'key': 'relationship_type'},
|
2647
|
+
]
|
2648
|
+
|
2649
|
+
# Determine the output format set
|
2650
|
+
output_formats = None
|
2651
|
+
if output_format_set:
|
2652
|
+
if isinstance(output_format_set, str):
|
2653
|
+
output_formats = select_output_format_set(output_format_set, output_format)
|
2654
|
+
elif isinstance(output_format_set, dict):
|
2655
|
+
output_formats = get_output_format_type_match(output_format_set, output_format)
|
2656
|
+
else:
|
2657
|
+
# Use default entity type to lookup the output format
|
2658
|
+
output_formats = select_output_format_set("RelatedTerms", output_format)
|
2659
|
+
|
2575
2660
|
# Return based on output format
|
2576
2661
|
if output_format == 'DICT':
|
2577
2662
|
return related_terms
|
@@ -2580,29 +2665,41 @@ class GlossaryBrowser(Client):
|
|
2580
2665
|
md_output = f"# Related Terms for {term_name}\n\n"
|
2581
2666
|
|
2582
2667
|
if output_format == 'LIST':
|
2583
|
-
#
|
2584
|
-
|
2585
|
-
|
2586
|
-
|
2587
|
-
|
2588
|
-
|
2668
|
+
# If we have an output format set with columns, use those
|
2669
|
+
columns = default_columns
|
2670
|
+
if output_formats and 'formats' in output_formats and 'columns' in output_formats['formats']:
|
2671
|
+
columns = output_formats['formats']['columns']
|
2672
|
+
|
2673
|
+
# Create a table header
|
2674
|
+
header_row = "| "
|
2675
|
+
separator_row = "|"
|
2676
|
+
for column in columns:
|
2677
|
+
header_row += f"{column['name']} | "
|
2678
|
+
separator_row += "------------|"
|
2679
|
+
|
2680
|
+
md_output += header_row + "\n"
|
2681
|
+
md_output += separator_row + "\n"
|
2682
|
+
|
2683
|
+
# Add data rows
|
2589
2684
|
for term in related_terms:
|
2590
|
-
|
2591
|
-
|
2592
|
-
|
2685
|
+
row = "| "
|
2686
|
+
for column in columns:
|
2687
|
+
key = column['key']
|
2688
|
+
value = term.get(key, '')
|
2689
|
+
row += f"{value} | "
|
2690
|
+
md_output += row + "\n"
|
2593
2691
|
else:
|
2594
2692
|
# For other formats, create a more detailed representation
|
2595
2693
|
for term in related_terms:
|
2596
2694
|
md_output += f"## {term['relationship_type']} Relationship\n\n"
|
2597
2695
|
md_output += (f"**First Term:** {term['first_term_display_name']} ("
|
2598
2696
|
f"{term['first_term_qualified_name']})\n\n")
|
2599
|
-
md_output += f"**Related Term:** {term[('
|
2600
|
-
'play_name')]} ({term['related_term_qualified_name']})\n\n"
|
2697
|
+
md_output += f"**Related Term:** {term['related_term_display_name']} ({term['related_term_qualified_name']})\n\n"
|
2601
2698
|
md_output += "---\n\n"
|
2602
2699
|
|
2603
2700
|
return md_output
|
2604
2701
|
|
2605
|
-
def get_term_details(self, term_name: str, effective_time: str = None, output_format: str = 'DICT') -> dict | str:
|
2702
|
+
def get_term_details(self, term_name: str, effective_time: str = None, output_format: str = 'DICT', output_format_set: str | dict = None) -> dict | str:
|
2606
2703
|
"""Retrieve detailed information about a term, combining basic term details and related terms.
|
2607
2704
|
|
2608
2705
|
This method combines the term details retrieved from get_term_by_guid and the related terms
|
@@ -2618,6 +2715,8 @@ class GlossaryBrowser(Client):
|
|
2618
2715
|
Type of output to produce:
|
2619
2716
|
DICT - output a dictionary with combined term details and related terms
|
2620
2717
|
REPORT - output a markdown report with combined term details and related terms
|
2718
|
+
output_format_set : str | dict, optional
|
2719
|
+
Output format set name or dictionary. Defaults to None.
|
2621
2720
|
|
2622
2721
|
Returns
|
2623
2722
|
-------
|
@@ -2804,7 +2903,7 @@ class GlossaryBrowser(Client):
|
|
2804
2903
|
async def _async_get_terms_by_name(self, term: str, glossary_guid: str = None, status_filter: list = [],
|
2805
2904
|
effective_time: str = None, for_lineage: bool = False,
|
2806
2905
|
for_duplicate_processing: bool = False, start_from: int = 0,
|
2807
|
-
page_size: int = None, output_format="JSON") -> list:
|
2906
|
+
page_size: int = None, output_format="JSON", output_format_set: str | dict = None) -> list:
|
2808
2907
|
"""Retrieve glossary terms by display name or qualified name. Async Version.
|
2809
2908
|
|
2810
2909
|
Parameters
|
@@ -2834,6 +2933,8 @@ class GlossaryBrowser(Client):
|
|
2834
2933
|
FORM - output markdown with a preamble for a form
|
2835
2934
|
REPORT - output markdown with a preamble for a report
|
2836
2935
|
DICT - output a simplified DICT structure
|
2936
|
+
output_format_set: str | dict, optional
|
2937
|
+
Output format set name or dictionary. Defaults to None.
|
2837
2938
|
|
2838
2939
|
Returns
|
2839
2940
|
-------
|
@@ -2879,12 +2980,12 @@ class GlossaryBrowser(Client):
|
|
2879
2980
|
elif output_format == 'DICT':
|
2880
2981
|
return None
|
2881
2982
|
if output_format != "JSON": # return a simplified markdown representation
|
2882
|
-
return self.generate_terms_md(term_elements, term, output_format)
|
2983
|
+
return self.generate_terms_md(term_elements, term, output_format, output_format_set)
|
2883
2984
|
return response.json().get("elementList", NO_TERMS_FOUND)
|
2884
2985
|
|
2885
2986
|
def get_terms_by_name(self, term: str, glossary_guid: str = None, status_filter: list = [],
|
2886
2987
|
effective_time: str = None, for_lineage: bool = False, for_duplicate_processing: bool = False,
|
2887
|
-
start_from: int = 0, page_size: int = None, output_format="JSON") -> list:
|
2988
|
+
start_from: int = 0, page_size: int = None, output_format="JSON", output_format_set: str | dict = None) -> list:
|
2888
2989
|
"""Retrieve glossary terms by display name or qualified name.
|
2889
2990
|
|
2890
2991
|
Parameters
|
@@ -2914,6 +3015,8 @@ class GlossaryBrowser(Client):
|
|
2914
3015
|
FORM - output markdown with a preamble for a form
|
2915
3016
|
REPORT - output markdown with a preamble for a report
|
2916
3017
|
DICT - output a simplified DICT structure
|
3018
|
+
output_format_set: str | dict, optional
|
3019
|
+
Output format set name or dictionary. Defaults to None.
|
2917
3020
|
|
2918
3021
|
Returns
|
2919
3022
|
-------
|
@@ -2933,10 +3036,10 @@ class GlossaryBrowser(Client):
|
|
2933
3036
|
loop = asyncio.get_event_loop()
|
2934
3037
|
response = loop.run_until_complete(
|
2935
3038
|
self._async_get_terms_by_name(term, glossary_guid, status_filter, effective_time, for_lineage,
|
2936
|
-
for_duplicate_processing, start_from, page_size, output_format))
|
3039
|
+
for_duplicate_processing, start_from, page_size, output_format, output_format_set))
|
2937
3040
|
return response
|
2938
3041
|
|
2939
|
-
async def _async_get_term_by_guid(self, term_guid: str, output_format: str = 'JSON') -> dict | str:
|
3042
|
+
async def _async_get_term_by_guid(self, term_guid: str, output_format: str = 'JSON', output_format_set: str | dict = None) -> dict | str:
|
2940
3043
|
"""Retrieve a term using its unique id. Async version.
|
2941
3044
|
Parameters
|
2942
3045
|
----------
|
@@ -2948,6 +3051,8 @@ class GlossaryBrowser(Client):
|
|
2948
3051
|
MD - output standard markdown with no preamble
|
2949
3052
|
FORM - output markdown with a preamble for a form
|
2950
3053
|
REPORT - output markdown with a preamble for a report
|
3054
|
+
output_format_set: str | dict, optional
|
3055
|
+
Output format set name or dictionary. Defaults to None.
|
2951
3056
|
|
2952
3057
|
Returns
|
2953
3058
|
-------
|
@@ -2974,21 +3079,23 @@ class GlossaryBrowser(Client):
|
|
2974
3079
|
if term_element == NO_TERMS_FOUND:
|
2975
3080
|
return NO_TERMS_FOUND
|
2976
3081
|
if output_format != 'JSON': # return a simplified markdown representation
|
2977
|
-
return self.generate_terms_md(term_element, "GUID", output_format)
|
3082
|
+
return self.generate_terms_md(term_element, "GUID", output_format, output_format_set)
|
2978
3083
|
return response.json().get("element", NO_TERMS_FOUND)
|
2979
3084
|
|
2980
|
-
def get_term_by_guid(self, term_guid: str, output_format: str = 'JSON') -> dict | str:
|
3085
|
+
def get_term_by_guid(self, term_guid: str, output_format: str = 'JSON', output_format_set: str | dict = None) -> dict | str:
|
2981
3086
|
"""Retrieve a term using its unique id. Async version.
|
2982
3087
|
Parameters
|
2983
3088
|
----------
|
2984
3089
|
term_guid : str
|
2985
3090
|
The GUID of the glossary term to retrieve.
|
2986
3091
|
output_format: str, default = 'JSON'
|
2987
|
-
|
3092
|
+
Type of output to produce:
|
2988
3093
|
JSON - output standard json
|
2989
3094
|
MD - output standard markdown with no preamble
|
2990
3095
|
FORM - output markdown with a preamble for a form
|
2991
3096
|
REPORT - output markdown with a preamble for a report
|
3097
|
+
output_format_set: str | dict, optional
|
3098
|
+
Output format set name or dictionary. Defaults to None.
|
2992
3099
|
Returns
|
2993
3100
|
-------
|
2994
3101
|
dict | str
|
@@ -3005,7 +3112,7 @@ class GlossaryBrowser(Client):
|
|
3005
3112
|
"""
|
3006
3113
|
|
3007
3114
|
loop = asyncio.get_event_loop()
|
3008
|
-
response = loop.run_until_complete(self._async_get_term_by_guid(term_guid, output_format))
|
3115
|
+
response = loop.run_until_complete(self._async_get_term_by_guid(term_guid, output_format, output_format_set))
|
3009
3116
|
|
3010
3117
|
return response
|
3011
3118
|
|
@@ -3258,7 +3365,7 @@ class GlossaryBrowser(Client):
|
|
3258
3365
|
|
3259
3366
|
return response
|
3260
3367
|
|
3261
|
-
def list_term_revision_history(self, term_guid: str, output_format: str = "DICT") -> list | str:
|
3368
|
+
def list_term_revision_history(self, term_guid: str, output_format: str = "DICT", output_format_set: str | dict = None) -> list | str:
|
3262
3369
|
"""
|
3263
3370
|
Retrieve the revision history for a term.
|
3264
3371
|
|
@@ -3272,6 +3379,8 @@ class GlossaryBrowser(Client):
|
|
3272
3379
|
output_format : str, optional
|
3273
3380
|
The format in which to return the results. Can be "DICT", "MD", or "LIST".
|
3274
3381
|
Defaults to "DICT".
|
3382
|
+
output_format_set : str | dict, optional
|
3383
|
+
Output format set name or dictionary. Defaults to None.
|
3275
3384
|
|
3276
3385
|
Returns
|
3277
3386
|
-------
|
@@ -3360,7 +3469,7 @@ class GlossaryBrowser(Client):
|
|
3360
3469
|
# Default to DICT format
|
3361
3470
|
return sorted_entries
|
3362
3471
|
|
3363
|
-
def list_full_term_history(self, term_guid: str,
|
3472
|
+
def list_full_term_history(self, term_guid: str, output_format: str = "DICT", output_format_set: str | dict = None) -> list | str:
|
3364
3473
|
"""
|
3365
3474
|
Retrieves and formats the entire version history of a specific term in the repository.
|
3366
3475
|
The version history is either returned as a list of dictionaries or in a Markdown table
|
@@ -3374,15 +3483,17 @@ class GlossaryBrowser(Client):
|
|
3374
3483
|
---------
|
3375
3484
|
term_guid: The unique identifier of the glossary term for which the version
|
3376
3485
|
history needs to be retrieved.
|
3377
|
-
|
3486
|
+
output_format: The format in which the history should be returned. It can be
|
3378
3487
|
either "DICT" (a list of dictionaries) or "LIST" (a Markdown table).
|
3379
3488
|
Defaults to "DICT".
|
3489
|
+
output_format_set: str | dict, optional
|
3490
|
+
Output format set name or dictionary. Defaults to None.
|
3380
3491
|
|
3381
3492
|
Returns
|
3382
3493
|
-------
|
3383
3494
|
list | str: A list of dictionaries representing the version history
|
3384
|
-
(if
|
3385
|
-
(if
|
3495
|
+
(if output_format is "DICT"), or a Markdown table of the version details
|
3496
|
+
(if output_format is "LIST"). If no history is found, returns a string
|
3386
3497
|
message "No History Found".
|
3387
3498
|
"""
|
3388
3499
|
history = self.get_term_versions(term_guid)
|
@@ -3411,9 +3522,9 @@ class GlossaryBrowser(Client):
|
|
3411
3522
|
"versionIdentifier": version_identifier,
|
3412
3523
|
})
|
3413
3524
|
sorted_history = sorted(version_history, key=lambda i: i['version'], reverse=True)
|
3414
|
-
if
|
3525
|
+
if output_format == "DICT":
|
3415
3526
|
return sorted_history
|
3416
|
-
elif
|
3527
|
+
elif output_format == "LIST":
|
3417
3528
|
# Get the headers from the keys of the first dictionary
|
3418
3529
|
headers = sorted_history[0].keys()
|
3419
3530
|
|
@@ -3437,7 +3548,7 @@ class GlossaryBrowser(Client):
|
|
3437
3548
|
effective_time: str = None, starts_with: bool = False, ends_with: bool = False,
|
3438
3549
|
ignore_case: bool = False, for_lineage: bool = False,
|
3439
3550
|
for_duplicate_processing: bool = False, start_from: int = 0,
|
3440
|
-
page_size: int = None, output_format: str = "JSON", ) -> list | str:
|
3551
|
+
page_size: int = None, output_format: str = "JSON", output_format_set: str | dict = None) -> list | str:
|
3441
3552
|
"""Retrieve the list of glossary term metadata elements that contain the search string.
|
3442
3553
|
|
3443
3554
|
Parameters
|
@@ -3532,14 +3643,14 @@ class GlossaryBrowser(Client):
|
|
3532
3643
|
elif output_format == 'DICT':
|
3533
3644
|
return None
|
3534
3645
|
if output_format != "JSON": # return a simplified markdown representation
|
3535
|
-
return self.generate_terms_md(term_elements, search_string, output_format)
|
3646
|
+
return self.generate_terms_md(term_elements, search_string, output_format, output_format_set)
|
3536
3647
|
return response.json().get("elementList", NO_TERMS_FOUND)
|
3537
3648
|
|
3538
3649
|
def find_glossary_terms(self, search_string: str, glossary_guid: str = None, status_filter: list = [],
|
3539
3650
|
effective_time: str = None, starts_with: bool = False, ends_with: bool = False,
|
3540
3651
|
ignore_case: bool = False, for_lineage: bool = False,
|
3541
3652
|
for_duplicate_processing: bool = False, start_from: int = 0, page_size: int = None,
|
3542
|
-
output_format: str = "JSON", ) -> list | str:
|
3653
|
+
output_format: str = "JSON", output_format_set: str | dict = None) -> list | str:
|
3543
3654
|
"""Retrieve the list of glossary term metadata elements that contain the search string.
|
3544
3655
|
|
3545
3656
|
Parameters
|
@@ -3577,6 +3688,8 @@ class GlossaryBrowser(Client):
|
|
3577
3688
|
MD - output standard markdown with no preamble
|
3578
3689
|
FORM - output markdown with a preamble for a form
|
3579
3690
|
REPORT - output markdown with a preamble for a report
|
3691
|
+
output_format_set: str | dict, optional
|
3692
|
+
Output format set name or dictionary. Defaults to None.
|
3580
3693
|
|
3581
3694
|
Returns
|
3582
3695
|
-------
|
@@ -3605,7 +3718,7 @@ class GlossaryBrowser(Client):
|
|
3605
3718
|
response = loop.run_until_complete(
|
3606
3719
|
self._async_find_glossary_terms(search_string, glossary_guid, status_filter, effective_time, starts_with,
|
3607
3720
|
ends_with, ignore_case, for_lineage, for_duplicate_processing, start_from,
|
3608
|
-
page_size, output_format))
|
3721
|
+
page_size, output_format, output_format_set))
|
3609
3722
|
|
3610
3723
|
return response
|
3611
3724
|
|