pyegeria 5.3.8.3__py3-none-any.whl → 5.3.8.4__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.
pyegeria/__init__.py CHANGED
@@ -95,7 +95,8 @@ from .md_processing_utils import (extract_command, process_glossary_upsert_comma
95
95
  get_current_datetime_string, process_per_proj_upsert_command, command_list,
96
96
  render_markdown, process_provenance_command, process_blueprint_upsert_command,
97
97
  process_solution_component_upsert_command, process_set_categories_parent_command,
98
- process_term_list_command)
98
+ process_term_list_command, process_glossary_list_command,process_category_list_command,
99
+ process_term_history_command,)
99
100
 
100
101
  #
101
102
  # The following assignments were generated by the `create_tech_guid_lists.py` utility that uses the pyegeria functions
@@ -12,7 +12,8 @@ from pyegeria import (extract_command, process_glossary_upsert_command, process_
12
12
  process_categories_upsert_command, process_provenance_command,
13
13
  process_set_categories_parent_command, get_current_datetime_string,
14
14
  process_per_proj_upsert_command, command_list, EgeriaTech, process_blueprint_upsert_command,
15
- process_solution_component_upsert_command, dr_egeria_state, process_term_list_command)
15
+ process_solution_component_upsert_command, dr_egeria_state, process_term_list_command,
16
+ process_category_list_command, process_glossary_list_command, process_term_history_command)
16
17
 
17
18
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
18
19
  EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
@@ -96,9 +97,18 @@ def process_markdown_file(file_path: str, directive: str, server: str, url: str,
96
97
  elif potential_command in ["Create Term", "Update Term"]:
97
98
  result = process_term_upsert_command(client, dr_egeria_state.get_element_dictionary(), current_block,
98
99
  directive)
100
+ elif potential_command in ["List Term History", "Term History"]:
101
+ result = process_term_history_command(client, dr_egeria_state.get_element_dictionary(), current_block,
102
+ directive)
99
103
  elif potential_command in ["List Terms", "List Glossary Terms"]:
100
104
  result = process_term_list_command(client, dr_egeria_state.get_element_dictionary(), current_block,
101
105
  directive)
106
+ elif potential_command in ["List Categories", "List Glossary Categories"]:
107
+ result = process_category_list_command(client, dr_egeria_state.get_element_dictionary(), current_block,
108
+ directive)
109
+ elif potential_command in ["List Glossaries"]:
110
+ result = process_glossary_list_command(client, dr_egeria_state.get_element_dictionary(), current_block,
111
+ directive)
102
112
  elif potential_command in ["Create Personal Project", "Update Personal Project"]:
103
113
  result = process_per_proj_upsert_command(client, dr_egeria_state.get_element_dictionary(),
104
114
  current_block, directive)
@@ -128,7 +128,7 @@ def delete_glossary(server, url, userid, password, timeout, glossary_guid):
128
128
  m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
129
129
  token = m_client.create_egeria_bearer_token()
130
130
  try:
131
- m_client.delete_glossary(glossary_guid)
131
+ m_client.delete_glossary(glossary_guid, cascade = True)
132
132
 
133
133
  click.echo(f"Deleted glossary: {glossary_guid}")
134
134
 
@@ -119,7 +119,7 @@ def display_categories(
119
119
  "Qualified Name & GUID", width=38, no_wrap=True, justify="center"
120
120
  )
121
121
  table.add_column("Description")
122
- table.add_column("In Glossary (Qualified Name)")
122
+ table.add_column("In Glossary")
123
123
  table.add_column("Parent Category")
124
124
 
125
125
  categories = m_client.find_glossary_categories(search_string)
@@ -15,6 +15,7 @@ import time
15
15
 
16
16
  from rich import box
17
17
  from rich.console import Console
18
+ from rich.markdown import Markdown
18
19
  from rich.prompt import Prompt
19
20
  from rich.table import Table
20
21
  from rich.text import Text
@@ -128,6 +129,7 @@ def display_glossaries(
128
129
  table.add_column("Language")
129
130
  table.add_column("Description")
130
131
  table.add_column("Usage")
132
+ table.add_column("Categories")
131
133
 
132
134
  glossaries = m_client.find_glossaries(search_string)
133
135
  if type(glossaries) is list:
@@ -142,7 +144,15 @@ def display_glossaries(
142
144
  language = glossary["glossaryProperties"].get("language",'---')
143
145
  description = glossary["glossaryProperties"].get("description",'---')
144
146
  usage = glossary["glossaryProperties"].get("usage",'---')
145
- table.add_row(display_name, q_name, language, description, usage)
147
+
148
+ categories = m_client.get_categories_for_glossary(guid)
149
+ cat_md = ''
150
+ if type(categories) is list:
151
+ for category in categories:
152
+ cat_md += f"* {category['glossaryCategoryProperties'][('displayName')]}\n"
153
+ cat_md = cat_md.strip()
154
+
155
+ table.add_row(display_name, q_name, language, description, usage, Markdown(cat_md))
146
156
 
147
157
  console.print(table)
148
158
 
@@ -189,7 +189,7 @@ def display_glossary_terms(
189
189
  )
190
190
  abbrev = Text(props.get("abbreviation", " "), style=style, justify="center")
191
191
  summary = Text(props.get("summary", " "), style=style)
192
- description = Text(props.get("description", " "), style=style)
192
+ description = Markdown(props.get("description"))
193
193
  version = Text(
194
194
  props.get("publishVersionIdentifier", " "),
195
195
  style=style,
@@ -223,6 +223,7 @@ def display_glossary_terms(
223
223
  category_list_md += f"* {category_name}\n"
224
224
  term_abb_ver_out = Markdown(f"{display_name}\n---\n{abbrev}\n---\n{version}")
225
225
  category_list_out = Markdown(category_list_md)
226
+
226
227
  term_status = term["elementHeader"].get("status","---")
227
228
  table.add_row(
228
229
  term_abb_ver_out,