pyegeria 5.3.6.2.4__py3-none-any.whl → 5.3.6.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.
- pyegeria/__init__.py +3 -0
- pyegeria/commands/cat/{freddies-inbox → dr_egeria_inbox}/freddie_intro.md +64 -16
- pyegeria/commands/cat/{freddie_jupyter.py → dr_egeria_jupyter.py} +8 -16
- pyegeria/commands/cat/{freddie_md.py → dr_egeria_md.py} +29 -32
- pyegeria/commands/cat/glossary_actions.py +59 -1
- pyegeria/commands/cat/list_categories.py +185 -0
- pyegeria/commands/cat/list_glossaries.py +26 -33
- pyegeria/commands/cat/list_terms.py +47 -47
- pyegeria/commands/cli/egeria.py +51 -61
- pyegeria/commands/cli/egeria_cat.py +53 -31
- pyegeria/create_tech_guid_lists.py +2 -5
- pyegeria/glossary_browser_omvs.py +257 -105
- pyegeria/glossary_manager_omvs.py +148 -1591
- pyegeria/md_processing_utils.py +816 -0
- {pyegeria-5.3.6.2.4.dist-info → pyegeria-5.3.6.3.dist-info}/METADATA +1 -1
- {pyegeria-5.3.6.2.4.dist-info → pyegeria-5.3.6.3.dist-info}/RECORD +21 -29
- {pyegeria-5.3.6.2.4.dist-info → pyegeria-5.3.6.3.dist-info}/entry_points.txt +5 -0
- pyegeria/commands/cat/freddie_jup.py +0 -124
- pyegeria/commands/cat/freddie_utils.py +0 -590
- pyegeria/commands/cat/freddies-outbox/Terms-2025-03-06-13-19-29-Report.md +0 -69
- pyegeria/commands/cat/freddies-outbox/Terms-2025-03-06-13-20-30-Update-Form.md +0 -78
- pyegeria/commands/cat/glossary_creation_experiment.ipynb +0 -235
- pyegeria/test_j.html +0 -0
- pyegeria/test_m.html +0 -213
- pyegeria/test_m1.html +0 -273
- pyegeria/test_mer.ipynb +0 -596
- pyegeria/test_w.html +0 -213
- /pyegeria/commands/cat/{freddies-inbox → dr_egeria_inbox}/glossary_creation_experiment.ipynb +0 -0
- /pyegeria/commands/cat/{freddies-inbox → dr_egeria_inbox}/glossary_exp.md +0 -0
- {pyegeria-5.3.6.2.4.dist-info → pyegeria-5.3.6.3.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.6.2.4.dist-info → pyegeria-5.3.6.3.dist-info}/WHEEL +0 -0
@@ -45,8 +45,8 @@ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
|
45
45
|
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
46
46
|
EGERIA_GLOSSARY_PATH = os.environ.get("EGERIA_GLOSSARY_PATH", None)
|
47
47
|
EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", "/Users/dwolfson/localGit/egeria-v5-3/egeria-python")
|
48
|
-
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "pyegeria/commands/cat/
|
49
|
-
EGERIA_OUTBOX_PATH = os.environ.get("EGERIA_OUTBOX_PATH", "pyegeria/commands/cat/
|
48
|
+
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "pyegeria/commands/cat/dr_egeria_inbox")
|
49
|
+
EGERIA_OUTBOX_PATH = os.environ.get("EGERIA_OUTBOX_PATH", "pyegeria/commands/cat/dr_egeria_outbox")
|
50
50
|
|
51
51
|
|
52
52
|
|
@@ -58,8 +58,7 @@ def display_glossaries(
|
|
58
58
|
user_pass: str = EGERIA_USER_PASSWORD,
|
59
59
|
jupyter: bool = EGERIA_JUPYTER,
|
60
60
|
width: int = EGERIA_WIDTH,
|
61
|
-
|
62
|
-
form: bool = False,
|
61
|
+
output_format: str = "JSON"
|
63
62
|
):
|
64
63
|
"""Display either a specified glossary or all glossaries if the search_string is '*'.
|
65
64
|
Parameters
|
@@ -78,35 +77,38 @@ def display_glossaries(
|
|
78
77
|
A boolean indicating whether the output is intended for a Jupyter notebook (default is EGERIA_JUPYTER).
|
79
78
|
width : int, optional
|
80
79
|
The width of the console output (default is EGERIA_WIDTH).
|
81
|
-
|
82
|
-
|
83
|
-
The filepath is derived from the environment variables EGERIA_ROOT_PATH and EGERIA_OUTPUT_PATH, respectively.
|
84
|
-
form: bool, [default=False]
|
85
|
-
If true and md is true, a form for the glossaries will be created as a markdown file.
|
86
|
-
If false and md is true, a markdown report for the glossaries will be created.
|
80
|
+
output_format: str, optional, default is 'JSON'
|
81
|
+
One of TABLE, FORM, REPORT
|
87
82
|
"""
|
88
83
|
m_client = EgeriaTech(view_server, view_url, user_id=user, user_pwd=user_pass)
|
89
84
|
token = m_client.create_egeria_bearer_token()
|
90
|
-
|
85
|
+
console = Console(
|
86
|
+
style="bold bright_white on black",
|
87
|
+
width=width,
|
88
|
+
force_terminal=not jupyter,
|
89
|
+
)
|
91
90
|
|
92
91
|
try:
|
93
|
-
if
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
92
|
+
if output_format == "FORM":
|
93
|
+
action = "Update-Form"
|
94
|
+
elif output_format == "REPORT":
|
95
|
+
action = "Report"
|
96
|
+
if output_format != "TABLE":
|
98
97
|
file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_OUTBOX_PATH)
|
99
98
|
file_name = f"Glossaries-{time.strftime('%Y-%m-%d-%H-%M-%S')}-{action}.md"
|
100
99
|
full_file_path = os.path.join(file_path, file_name)
|
101
100
|
os.makedirs(os.path.dirname(full_file_path), exist_ok=True)
|
102
|
-
output = m_client.find_glossaries(search_string,
|
101
|
+
output = m_client.find_glossaries(search_string, None, output_format=output_format)
|
103
102
|
if output == "NO_GLOSSARIES_FOUND":
|
104
103
|
print(f"\n==> No glossaries found for search string '{search_string}'")
|
105
104
|
return
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
105
|
+
try:
|
106
|
+
with open(full_file_path, 'w') as f:
|
107
|
+
f.write(output)
|
108
|
+
print(f"\n==> Glossaries output written to {full_file_path}")
|
109
|
+
return
|
110
|
+
except Exception:
|
111
|
+
console.print_exception()
|
110
112
|
|
111
113
|
table = Table(
|
112
114
|
title=f"Glossary List @ {time.asctime()}",
|
@@ -141,11 +143,7 @@ def display_glossaries(
|
|
141
143
|
description = glossary["glossaryProperties"].get("description",'---')
|
142
144
|
usage = glossary["glossaryProperties"].get("usage",'---')
|
143
145
|
table.add_row(display_name, q_name, language, description, usage)
|
144
|
-
|
145
|
-
style="bold bright_white on black",
|
146
|
-
width=width,
|
147
|
-
force_terminal=not jupyter,
|
148
|
-
)
|
146
|
+
|
149
147
|
console.print(table)
|
150
148
|
|
151
149
|
except (InvalidParameterException, PropertyServerException) as e:
|
@@ -172,14 +170,9 @@ def main():
|
|
172
170
|
search_string = Prompt.ask(
|
173
171
|
"Enter the glossary you are searching for or '*' for all:", default="*"
|
174
172
|
)
|
175
|
-
|
176
|
-
md = True if mdq.lower() == "y" else False
|
177
|
-
|
178
|
-
formq = Prompt.ask("Do you want to create a form?", choices=["y", "n"], default="n")
|
179
|
-
form = True if formq.lower() == "y" else False
|
180
|
-
|
173
|
+
output_format = Prompt.ask("What output format do you want?", choices=["TABLE", "FORM", "REPORT"], default="TABLE")
|
181
174
|
display_glossaries(search_string, server, url, userid,
|
182
|
-
user_pass,
|
175
|
+
user_pass, output_format=output_format)
|
183
176
|
|
184
177
|
except KeyboardInterrupt:
|
185
178
|
pass
|
@@ -3,8 +3,6 @@
|
|
3
3
|
SPDX-License-Identifier: Apache-2.0
|
4
4
|
Copyright Contributors to the ODPi Egeria project.
|
5
5
|
|
6
|
-
Unit tests for the Utils helper functions using the Pytest framework.
|
7
|
-
|
8
6
|
|
9
7
|
A simple display for glossary terms
|
10
8
|
"""
|
@@ -15,6 +13,7 @@ import time
|
|
15
13
|
|
16
14
|
from rich import box
|
17
15
|
from rich.console import Console
|
16
|
+
from rich.markdown import Markdown
|
18
17
|
from rich.prompt import Prompt
|
19
18
|
from rich.table import Table
|
20
19
|
from rich.text import Text
|
@@ -23,8 +22,8 @@ from pyegeria import (
|
|
23
22
|
EgeriaTech,
|
24
23
|
InvalidParameterException,
|
25
24
|
PropertyServerException,
|
26
|
-
UserNotAuthorizedException,
|
27
|
-
)
|
25
|
+
UserNotAuthorizedException, NO_CATEGORIES_FOUND,
|
26
|
+
)
|
28
27
|
from pyegeria.commands.cat.glossary_actions import EGERIA_HOME_GLOSSARY_GUID
|
29
28
|
|
30
29
|
disable_ssl_warnings = True
|
@@ -45,8 +44,8 @@ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
|
|
45
44
|
EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
|
46
45
|
EGERIA_GLOSSARY_PATH = os.environ.get("EGERIA_GLOSSARY_PATH", None)
|
47
46
|
EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", "/Users/dwolfson/localGit/egeria-v5-3/egeria-python")
|
48
|
-
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "pyegeria/commands/cat/
|
49
|
-
EGERIA_OUTBOX_PATH = os.environ.get("EGERIA_OUTBOX_PATH", "pyegeria/commands/cat/
|
47
|
+
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "pyegeria/commands/cat/dr_egeria_inbox")
|
48
|
+
EGERIA_OUTBOX_PATH = os.environ.get("EGERIA_OUTBOX_PATH", "pyegeria/commands/cat/dr_egeria_outbox")
|
50
49
|
|
51
50
|
|
52
51
|
def display_glossary_terms(
|
@@ -59,8 +58,7 @@ def display_glossary_terms(
|
|
59
58
|
user_pass: str = EGERIA_USER_PASSWORD,
|
60
59
|
jupyter: bool = EGERIA_JUPYTER,
|
61
60
|
width: int = EGERIA_WIDTH,
|
62
|
-
|
63
|
-
form: bool = False,
|
61
|
+
output_format: str = "TABLE",
|
64
62
|
):
|
65
63
|
"""Display a table of glossary terms filtered by search_string and glossary, if specified. If no
|
66
64
|
filters then all terms are displayed. If glossary_guid or name is specified, then only terms from that
|
@@ -89,40 +87,36 @@ def display_glossary_terms(
|
|
89
87
|
Flag to indicate if the output should be formatted for Jupyter notebook. Defaults to EGERIA_JUPYTER.
|
90
88
|
width : int
|
91
89
|
The width of the console output. Defaults to EGERIA_WIDTH.
|
92
|
-
|
93
|
-
|
94
|
-
The filepath is derived from the environment variables EGERIA_ROOT_PATH and EGERIA_OUTPUT_PATH, respectively.
|
95
|
-
form: bool, [default=False]
|
96
|
-
If true and md is true, a form for the terms will be created as a markdown file.
|
97
|
-
If false and md is true, a markdown report for the terms will be created.
|
90
|
+
output_format: str, optional, default is 'JSON'
|
91
|
+
One of TABLE, FORM, REPORT
|
98
92
|
"""
|
99
93
|
|
100
94
|
console = Console(
|
101
95
|
style="bold bright_white on black", width=width, force_terminal=not jupyter
|
102
96
|
)
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
if
|
97
|
+
try:
|
98
|
+
g_client = EgeriaTech(view_server, view_url, user_id, user_pass)
|
99
|
+
token = g_client.create_egeria_bearer_token(user_id, user_pass)
|
100
|
+
if (glossary_name is not None) and (glossary_name != "*"):
|
101
|
+
glossary_guid = g_client.get_guid_for_name(glossary_name)
|
102
|
+
if glossary_guid == "Glossary guid not found":
|
103
|
+
console.print(
|
104
|
+
f"\nThe glossary name {glossary_name} was not found. Please try using the glossary guid"
|
105
|
+
)
|
106
|
+
sys.exit(1)
|
107
|
+
elif (glossary_guid is not None) and (len(glossary_guid) < 10):
|
108
|
+
glossary_guid = None
|
109
|
+
|
110
|
+
if output_format == "FORM":
|
117
111
|
action = "Update-Form"
|
118
|
-
|
112
|
+
elif output_format == "REPORT":
|
119
113
|
action = "Report"
|
120
|
-
|
114
|
+
if output_format != "TABLE":
|
121
115
|
file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_OUTBOX_PATH)
|
122
116
|
file_name = f"Terms-{time.strftime('%Y-%m-%d-%H-%M-%S')}-{action}.md"
|
123
117
|
full_file_path = os.path.join(file_path, file_name)
|
124
118
|
os.makedirs(os.path.dirname(full_file_path), exist_ok=True)
|
125
|
-
output = g_client.
|
119
|
+
output = g_client.find_glossary_terms(search_string, glossary_guid, output_format=output_format)
|
126
120
|
if output == "NO_TERMS_FOUND":
|
127
121
|
print(f"\n==> No terms found for search string '{search_string}'")
|
128
122
|
return
|
@@ -130,14 +124,14 @@ def display_glossary_terms(
|
|
130
124
|
f.write(output)
|
131
125
|
print(f"\n==> Terms output written to {full_file_path}")
|
132
126
|
return
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
127
|
+
|
128
|
+
except (
|
129
|
+
InvalidParameterException,
|
130
|
+
PropertyServerException,
|
131
|
+
UserNotAuthorizedException,
|
132
|
+
) as e:
|
133
|
+
console.print_exception()
|
134
|
+
|
141
135
|
|
142
136
|
|
143
137
|
def generate_table(search_string: str, glossary_guid: str) -> Table:
|
@@ -163,6 +157,7 @@ def display_glossary_terms(
|
|
163
157
|
table.add_column("Glossary")
|
164
158
|
table.add_column("Status")
|
165
159
|
table.add_column("Example")
|
160
|
+
table.add_column("Categories")
|
166
161
|
|
167
162
|
terms = g_client.find_glossary_terms(
|
168
163
|
search_string,
|
@@ -218,7 +213,16 @@ def display_glossary_terms(
|
|
218
213
|
glossary_info[glossary_guid] = glossary_name
|
219
214
|
else:
|
220
215
|
glossary_name = "---"
|
221
|
-
|
216
|
+
category_list_md = ""
|
217
|
+
category_list = g_client.get_categories_for_term(term_guid)
|
218
|
+
if type(category_list) is str and category_list == NO_CATEGORIES_FOUND:
|
219
|
+
category_list_md = ['---']
|
220
|
+
elif isinstance(category_list, list) and len(category_list) > 0:
|
221
|
+
for category in category_list:
|
222
|
+
category_name = category["glossaryCategoryProperties"].get("displayName",'---')
|
223
|
+
category_list_md += f"* {category_name}\n"
|
224
|
+
|
225
|
+
category_list_out = Markdown(category_list_md)
|
222
226
|
term_status = term["elementHeader"].get("status","---")
|
223
227
|
table.add_row(
|
224
228
|
display_name,
|
@@ -230,6 +234,7 @@ def display_glossary_terms(
|
|
230
234
|
glossary_name,
|
231
235
|
term_status,
|
232
236
|
example,
|
237
|
+
category_list_out,
|
233
238
|
style="bold white on black",
|
234
239
|
)
|
235
240
|
|
@@ -273,16 +278,11 @@ def main():
|
|
273
278
|
"Enter the name of the glossary to search or '*' for all glossaries:",
|
274
279
|
default="*",
|
275
280
|
)
|
276
|
-
|
277
|
-
mdq = Prompt.ask("Do you want to create a markdown report?", choices=["y", "n"], default="n")
|
278
|
-
md = True if mdq.lower() == "y" else False
|
279
|
-
|
280
|
-
formq = Prompt.ask("Do you want to create a form?", choices=["y", "n"], default="n")
|
281
|
-
form = True if formq.lower() == "y" else False
|
281
|
+
output_format = Prompt.ask("What output format do you want?", choices=["TABLE", "FORM", "REPORT"], default="TABLE")
|
282
282
|
|
283
283
|
display_glossary_terms(
|
284
284
|
search_string, guid, glossary_name, server, url,
|
285
|
-
userid, user_pass,
|
285
|
+
userid, user_pass, output_format= output_format
|
286
286
|
)
|
287
287
|
|
288
288
|
except KeyboardInterrupt:
|
pyegeria/commands/cli/egeria.py
CHANGED
@@ -27,7 +27,16 @@ from pyegeria.commands.cat.glossary_actions import (
|
|
27
27
|
delete_term,
|
28
28
|
export_terms_csv,
|
29
29
|
import_terms_csv,
|
30
|
+
create_category,
|
31
|
+
update_category,
|
32
|
+
delete_category,
|
33
|
+
add_term_to_category,
|
34
|
+
remove_term_from_category
|
30
35
|
)
|
36
|
+
from pyegeria.commands.cat.dr_egeria_jupyter import process_jupyter_notebook
|
37
|
+
from pyegeria.commands.cat.dr_egeria_md_file import process_markdown_file
|
38
|
+
|
39
|
+
from pyegeria.commands.cat.list_categories import display_categories
|
31
40
|
from pyegeria.commands.cat.list_assets import display_assets
|
32
41
|
from pyegeria.commands.cat.list_cert_types import display_certifications
|
33
42
|
from pyegeria.commands.cat.list_collections import display_collections
|
@@ -44,6 +53,7 @@ from pyegeria.commands.cat.list_tech_types import display_tech_types
|
|
44
53
|
from pyegeria.commands.cat.list_terms import display_glossary_terms
|
45
54
|
from pyegeria.commands.cat.list_todos import display_to_dos as list_todos
|
46
55
|
from pyegeria.commands.cat.list_user_ids import list_user_ids
|
56
|
+
|
47
57
|
from pyegeria.commands.cli.egeria_login_tui import login
|
48
58
|
from pyegeria.commands.cli.egeria_ops import show_server
|
49
59
|
from pyegeria.commands.cli.ops_config import Config
|
@@ -220,12 +230,12 @@ from pyegeria.commands.tech.list_valid_metadata_values import display_metadata_v
|
|
220
230
|
|
221
231
|
@click.option(
|
222
232
|
"--inbox_path",
|
223
|
-
default=os.environ.get("EGERIA_INBOX_PATH", "loading-bay/
|
233
|
+
default=os.environ.get("EGERIA_INBOX_PATH", "loading-bay/dr_egeria_inbox"),
|
224
234
|
help="Path to outbox files",
|
225
235
|
)
|
226
236
|
@click.option(
|
227
237
|
"--outbox_path",
|
228
|
-
default=os.environ.get("EGERIA_OUTBOX_PATH", "distribution-hub/
|
238
|
+
default=os.environ.get("EGERIA_OUTBOX_PATH", "distribution-hub/dr_egeria_outbox"),
|
229
239
|
help="Path to outbox files",
|
230
240
|
)
|
231
241
|
|
@@ -1139,19 +1149,13 @@ def glossary_group(ctx):
|
|
1139
1149
|
help="Optionally restrict search to a specific named glossary",
|
1140
1150
|
)
|
1141
1151
|
@click.option(
|
1142
|
-
"--
|
1143
|
-
|
1144
|
-
default=
|
1145
|
-
help="
|
1146
|
-
)
|
1147
|
-
@click.option(
|
1148
|
-
"--form",
|
1149
|
-
flag_value=True,
|
1150
|
-
default=False,
|
1151
|
-
help="Optionally display glossary list as an update form",
|
1152
|
+
"--output-format",
|
1153
|
+
type=click.Choice(["FORM", "REPORT", "TABLE"]),
|
1154
|
+
default="TABLE",
|
1155
|
+
help="Display on screen as table, or as FORM or REPORT file",
|
1152
1156
|
)
|
1153
1157
|
@click.pass_context
|
1154
|
-
def show_terms(ctx, search_string, glossary_guid, glossary_name,
|
1158
|
+
def show_terms(ctx, search_string, glossary_guid, glossary_name, output_format):
|
1155
1159
|
"""Find and display glossary terms"""
|
1156
1160
|
c = ctx.obj
|
1157
1161
|
display_glossary_terms(
|
@@ -1164,27 +1168,42 @@ def show_terms(ctx, search_string, glossary_guid, glossary_name, markdown, form)
|
|
1164
1168
|
c.password,
|
1165
1169
|
c.jupyter,
|
1166
1170
|
c.width,
|
1167
|
-
|
1168
|
-
form,
|
1171
|
+
output_format,
|
1169
1172
|
)
|
1170
1173
|
|
1174
|
+
@glossary_group.command("glossary-categories")
|
1175
|
+
@click.option("--search_string", default="*", help="Name to search for categories")
|
1176
|
+
@click.option(
|
1177
|
+
"--output-format",
|
1178
|
+
type=click.Choice(["FORM", "REPORT", "TABLE"]),
|
1179
|
+
default="TABLE",
|
1180
|
+
help="Display on screen as table, or as FORM or REPORT file",
|
1181
|
+
)
|
1182
|
+
@click.pass_context
|
1183
|
+
def categories(ctx, search_string, output_format):
|
1184
|
+
"""Display a list of categories"""
|
1185
|
+
c = ctx.obj
|
1186
|
+
display_categories(
|
1187
|
+
search_string,
|
1188
|
+
c.view_server,
|
1189
|
+
c.view_server_url,
|
1190
|
+
c.userid,
|
1191
|
+
c.password,
|
1192
|
+
c.jupyter,
|
1193
|
+
c.width,
|
1194
|
+
output_format,
|
1195
|
+
)
|
1171
1196
|
|
1172
1197
|
@glossary_group.command("glossaries")
|
1173
1198
|
@click.option("--search_string", default="*", help="Name to search for glossaries")
|
1174
1199
|
@click.option(
|
1175
|
-
"--
|
1176
|
-
|
1177
|
-
default=
|
1178
|
-
help="
|
1179
|
-
)
|
1180
|
-
@click.option(
|
1181
|
-
"--form",
|
1182
|
-
flag_value=True,
|
1183
|
-
default=False,
|
1184
|
-
help="Optionally display glossary list as an update form",
|
1200
|
+
"--output-format",
|
1201
|
+
type=click.Choice(["FORM", "REPORT", "TABLE"]),
|
1202
|
+
default="TABLE",
|
1203
|
+
help="Display on screen as table, or as FORM or REPORT file",
|
1185
1204
|
)
|
1186
1205
|
@click.pass_context
|
1187
|
-
def glossaries(ctx, search_string,
|
1206
|
+
def glossaries(ctx, search_string, output_format):
|
1188
1207
|
"""Display a list of glossaries"""
|
1189
1208
|
c = ctx.obj
|
1190
1209
|
display_glossaries(
|
@@ -1195,8 +1214,7 @@ def glossaries(ctx, search_string, markdown, form):
|
|
1195
1214
|
c.password,
|
1196
1215
|
c.jupyter,
|
1197
1216
|
c.width,
|
1198
|
-
|
1199
|
-
form,
|
1217
|
+
output_format,
|
1200
1218
|
)
|
1201
1219
|
|
1202
1220
|
|
@@ -1453,7 +1471,11 @@ tell_glossary.add_command(delete_term)
|
|
1453
1471
|
tell_glossary.add_command(create_term)
|
1454
1472
|
tell_glossary.add_command(import_terms_csv)
|
1455
1473
|
tell_glossary.add_command(export_terms_csv)
|
1456
|
-
|
1474
|
+
tell_glossary.add_command(create_category)
|
1475
|
+
tell_glossary.add_command(delete_category)
|
1476
|
+
tell_glossary.add_command(update_category)
|
1477
|
+
tell_glossary.add_command(add_term_to_category)
|
1478
|
+
tell_glossary.add_command(remove_term_from_category)
|
1457
1479
|
|
1458
1480
|
@tell_cat.group("todo")
|
1459
1481
|
@click.pass_context
|
@@ -1541,38 +1563,6 @@ def show_project_dependencies(ctx, project):
|
|
1541
1563
|
)
|
1542
1564
|
|
1543
1565
|
|
1544
|
-
@glossary_group.command("glossary-terms")
|
1545
|
-
@click.option(
|
1546
|
-
"--search-string",
|
1547
|
-
default="*",
|
1548
|
-
help="List glossary terms similar to search string - minimum of 4 characters",
|
1549
|
-
)
|
1550
|
-
@click.option(
|
1551
|
-
"--glossary-guid",
|
1552
|
-
default=None,
|
1553
|
-
help="Optionally restrict search to glossary with the specified guid",
|
1554
|
-
)
|
1555
|
-
@click.option(
|
1556
|
-
"--glossary-name",
|
1557
|
-
default="*",
|
1558
|
-
help="Optionally restrict search to a specific named glossary",
|
1559
|
-
)
|
1560
|
-
@click.pass_context
|
1561
|
-
def show_terms(ctx, search_string, glossary_guid, glossary_name):
|
1562
|
-
"""Find and display glossary terms"""
|
1563
|
-
c = ctx.obj
|
1564
|
-
display_glossary_terms(
|
1565
|
-
search_string,
|
1566
|
-
glossary_guid,
|
1567
|
-
glossary_name,
|
1568
|
-
c.view_server,
|
1569
|
-
c.view_server_url,
|
1570
|
-
c.userid,
|
1571
|
-
c.password,
|
1572
|
-
c.jupyter,
|
1573
|
-
c.width,
|
1574
|
-
)
|
1575
|
-
|
1576
1566
|
|
1577
1567
|
@asset_group.command("asset-graph")
|
1578
1568
|
@click.argument("asset_guid", nargs=1)
|
@@ -26,7 +26,16 @@ from pyegeria.commands.cat.glossary_actions import (
|
|
26
26
|
delete_term,
|
27
27
|
export_terms_csv,
|
28
28
|
import_terms_csv,
|
29
|
-
|
29
|
+
create_category,
|
30
|
+
update_category,
|
31
|
+
delete_category,
|
32
|
+
add_term_to_category,
|
33
|
+
remove_term_from_category)
|
34
|
+
|
35
|
+
from pyegeria.commands.cat.dr_egeria_jupyter import process_jupyter_notebook
|
36
|
+
from pyegeria.commands.cat.dr_egeria_md_file import process_markdown_file
|
37
|
+
|
38
|
+
from pyegeria.commands.cat.list_categories import display_categories
|
30
39
|
from pyegeria.commands.cat.list_assets import display_assets
|
31
40
|
from pyegeria.commands.cat.list_cert_types import display_certifications
|
32
41
|
from pyegeria.commands.cat.list_collections import display_collections
|
@@ -150,12 +159,12 @@ from pyegeria.commands.tech.list_asset_types import display_asset_types
|
|
150
159
|
|
151
160
|
@click.option(
|
152
161
|
"--inbox_path",
|
153
|
-
default=os.environ.get("EGERIA_INBOX_PATH", "loading-bay/
|
162
|
+
default=os.environ.get("EGERIA_INBOX_PATH", "loading-bay/dr_egeria_inbox"),
|
154
163
|
help="Path to inbox files",
|
155
164
|
)
|
156
165
|
@click.option(
|
157
166
|
"--outbox_path",
|
158
|
-
default=os.environ.get("EGERIA_OUTBOX_PATH", "distribution-hub/
|
167
|
+
default=os.environ.get("EGERIA_OUTBOX_PATH", "distribution-hub/dr_egeria_outbox"),
|
159
168
|
help="Path to outbox files",
|
160
169
|
)
|
161
170
|
|
@@ -350,19 +359,13 @@ def glossary_group(ctx):
|
|
350
359
|
help="Optionally restrict search to a specific named glossary",
|
351
360
|
)
|
352
361
|
@click.option(
|
353
|
-
"--
|
354
|
-
|
355
|
-
default=
|
356
|
-
help="
|
357
|
-
)
|
358
|
-
@click.option(
|
359
|
-
"--form",
|
360
|
-
flag_value=True,
|
361
|
-
default=False,
|
362
|
-
help="Optionally display glossary list as an update form",
|
362
|
+
"--output-format",
|
363
|
+
type=click.Choice(["FORM", "REPORT", "TABLE"]),
|
364
|
+
default="TABLE",
|
365
|
+
help="Display on screen as table, or as FORM or REPORT file",
|
363
366
|
)
|
364
367
|
@click.pass_context
|
365
|
-
def show_terms(ctx, search_string, glossary_guid, glossary_name,
|
368
|
+
def show_terms(ctx, search_string, glossary_guid, glossary_name, output_format):
|
366
369
|
"""Find and display glossary terms"""
|
367
370
|
c = ctx.obj
|
368
371
|
display_glossary_terms(
|
@@ -375,27 +378,19 @@ def show_terms(ctx, search_string, glossary_guid, glossary_name, markdown, form)
|
|
375
378
|
c.password,
|
376
379
|
c.jupyter,
|
377
380
|
c.width,
|
378
|
-
|
379
|
-
form,
|
381
|
+
output_format,
|
380
382
|
)
|
381
383
|
|
382
|
-
|
383
384
|
@glossary_group.command("glossaries")
|
384
385
|
@click.option("--search_string", default="*", help="Name to search for glossaries")
|
385
386
|
@click.option(
|
386
|
-
"--
|
387
|
-
|
388
|
-
default=
|
389
|
-
help="
|
390
|
-
)
|
391
|
-
@click.option(
|
392
|
-
"--form",
|
393
|
-
flag_value=True,
|
394
|
-
default=False,
|
395
|
-
help="Optionally display glossary list as an update form",
|
387
|
+
"--output-format",
|
388
|
+
type=click.Choice(["FORM", "REPORT", "TABLE"]),
|
389
|
+
default="TABLE",
|
390
|
+
help="Display on screen as table, or as FORM or REPORT file",
|
396
391
|
)
|
397
392
|
@click.pass_context
|
398
|
-
def glossaries(ctx, search_string,
|
393
|
+
def glossaries(ctx, search_string, output_format):
|
399
394
|
"""Display a list of glossaries"""
|
400
395
|
c = ctx.obj
|
401
396
|
display_glossaries(
|
@@ -406,9 +401,32 @@ def glossaries(ctx, search_string, markdown, form):
|
|
406
401
|
c.password,
|
407
402
|
c.jupyter,
|
408
403
|
c.width,
|
409
|
-
|
410
|
-
|
404
|
+
output_format,
|
405
|
+
)
|
406
|
+
@glossary_group.command("glossary-categories")
|
407
|
+
@click.option("--search_string", default="*", help="Name to search for categories")
|
408
|
+
@click.option(
|
409
|
+
"--output-format",
|
410
|
+
type=click.Choice(["FORM", "REPORT", "TABLE"]),
|
411
|
+
default="TABLE",
|
412
|
+
help="Display on screen as table, or as FORM or REPORT file",
|
411
413
|
)
|
414
|
+
@click.pass_context
|
415
|
+
def categories(ctx, search_string, output_format):
|
416
|
+
"""Display a list of categories"""
|
417
|
+
c = ctx.obj
|
418
|
+
display_categories(
|
419
|
+
search_string,
|
420
|
+
c.view_server,
|
421
|
+
c.view_server_url,
|
422
|
+
c.userid,
|
423
|
+
c.password,
|
424
|
+
c.jupyter,
|
425
|
+
c.width,
|
426
|
+
output_format,
|
427
|
+
)
|
428
|
+
|
429
|
+
|
412
430
|
|
413
431
|
|
414
432
|
@info.command("collection")
|
@@ -664,7 +682,11 @@ tell_glossary.add_command(create_term)
|
|
664
682
|
tell_glossary.add_command(import_terms_csv)
|
665
683
|
tell_glossary.add_command(export_terms_csv)
|
666
684
|
tell_glossary.add_command(delete_term)
|
667
|
-
|
685
|
+
tell_glossary.add_command(create_category)
|
686
|
+
tell_glossary.add_command(delete_category)
|
687
|
+
tell_glossary.add_command(update_category)
|
688
|
+
tell_glossary.add_command(add_term_to_category)
|
689
|
+
tell_glossary.add_command(remove_term_from_category)
|
668
690
|
|
669
691
|
@tell.group("todo")
|
670
692
|
@click.pass_context
|
@@ -8,13 +8,10 @@ These GUIDS should be copied into the pyegeria/__init__.py.
|
|
8
8
|
"""
|
9
9
|
|
10
10
|
from datetime import datetime
|
11
|
-
|
12
11
|
from rich.console import Console
|
13
|
-
|
14
|
-
from pyegeria.server_operations import ServerOps
|
15
|
-
from pyegeria.automated_curation_omvs import AutomatedCuration
|
16
12
|
from pyegeria.egeria_tech_client import EgeriaTech
|
17
13
|
from pyegeria._globals import NO_ELEMENTS_FOUND
|
14
|
+
|
18
15
|
console = Console(width=200)
|
19
16
|
integration_server = "qs-integration-daemon"
|
20
17
|
|
@@ -35,7 +32,7 @@ def build_global_guid_lists(
|
|
35
32
|
tech_types = a_client.get_all_technology_types()
|
36
33
|
if type(tech_types) is list:
|
37
34
|
with open(file_name, "w") as f:
|
38
|
-
out =
|
35
|
+
out = "global template_guids, integration_guids\n"
|
39
36
|
f.write(out)
|
40
37
|
for tech_type in tech_types:
|
41
38
|
# get tech type details
|