pyegeria 5.2.0.9__py3-none-any.whl → 5.2.0.12__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.
@@ -11,7 +11,7 @@ This is an emerging capability based on the **click** package. Feedback welcome!
11
11
  """
12
12
  import click
13
13
  from trogon import tui
14
-
14
+ from pyegeria.commands.cli.egeria_login_tui import login
15
15
  from pyegeria.commands.cat.get_asset_graph import asset_viewer
16
16
  from pyegeria.commands.cat.get_collection import collection_viewer
17
17
  from pyegeria.commands.cat.get_project_dependencies import project_dependency_viewer
@@ -235,6 +235,12 @@ def cli(
235
235
  ctx.ensure_object(Config)
236
236
 
237
237
 
238
+ @cli.command("alogin")
239
+ @click.pass_context
240
+ def login(ctx):
241
+ login()
242
+
243
+
238
244
  #
239
245
  # my: Show
240
246
  #
@@ -0,0 +1,305 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+ A form exemplar for Egeria users to enter data into templates using Textual open source framework
6
+
7
+ Peter Coldicott
8
+ """
9
+
10
+ import os
11
+ from os import system
12
+
13
+ from textual.reactive import Reactive
14
+
15
+ from textual.app import App, ComposeResult
16
+ from textual.containers import (
17
+ Container,
18
+ Vertical,
19
+ HorizontalScroll,
20
+ VerticalScroll,
21
+ ScrollableContainer,
22
+ )
23
+ from textual import on, work
24
+ from textual.screen import ModalScreen, Screen
25
+ from textual.widgets import (
26
+ Input,
27
+ Static,
28
+ Button,
29
+ RichLog,
30
+ Label,
31
+ Tree,
32
+ Footer,
33
+ DataTable,
34
+ Header,
35
+ )
36
+
37
+ from typing import Any
38
+
39
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
40
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
41
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
42
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
43
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
44
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
45
+ )
46
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
47
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
48
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
49
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
50
+
51
+ disable_ssl_warnings = True
52
+
53
+ TITLE = "User Access"
54
+
55
+
56
+ class UserInfo(Screen):
57
+ """A screen to request user access info - required
58
+ If no information is supplied the access defaults to a set of
59
+ demo/test values:
60
+ User: erinoverview
61
+ Password: Secret
62
+ Platform URL: https://localhost:9443
63
+ View Server Name: view-server"""
64
+
65
+ BINDINGS = [("d", "toggle_dark", "Toggle dark mode")]
66
+
67
+ def __init__(self) -> None:
68
+ """Initialize the UserInfo Screen variables"""
69
+ self.app.dark = True
70
+ self.user = ""
71
+ self.password = ""
72
+ self.platformu = ""
73
+ self.view_server = ""
74
+ self.tech_type = ""
75
+ super().__init__()
76
+
77
+ def compose(self) -> ComposeResult:
78
+ self.log("In UserInfo - Compose ")
79
+ with VerticalScroll(id="user-container"):
80
+ yield Label("Username: ", classes="uprompt")
81
+ yield Input("", id="username", classes="uinput")
82
+ with VerticalScroll(id="pwd-container"):
83
+ yield Label("Password: ", classes="uprompt")
84
+ yield Input("", id="password", classes="uinput")
85
+ with VerticalScroll(id="platform-container"):
86
+ yield Label("Platform URL: ", classes="uprompt")
87
+ yield Input("", id="platform_url", classes="uinput")
88
+ with VerticalScroll(id="view-server-container"):
89
+ yield Label("View Server Name: ", classes="uprompt")
90
+ yield Input("", id="view_server", classes="uinput")
91
+ with HorizontalScroll(id="button-container"):
92
+ yield Button("Cancel", "warning", id="cancel")
93
+ yield Button("Submit", "primary", id="submit")
94
+ yield RichLog()
95
+ yield Footer()
96
+
97
+ def action_toggle_dark(self) -> None:
98
+ """An action to toggle dark mode."""
99
+
100
+ self.app.dark = not self.app.dark
101
+
102
+ def on_input_changed(self, event: Input.Changed) -> None:
103
+ """Detect input changed events and capture input value"""
104
+
105
+ try:
106
+ ivalue = str(event.value)
107
+ except ValueError:
108
+ return
109
+ else:
110
+ if event.input.id == "username":
111
+ self.user = ivalue
112
+ elif event.input.id == "password":
113
+ self.password = ivalue
114
+ elif event.input.id == "platform_url":
115
+ self.platformu = ivalue
116
+ elif event.input.id == "view_server":
117
+ self.view_server = ivalue
118
+ return
119
+
120
+ @on(Button.Pressed, "#submit")
121
+ async def on_submit(self) -> []:
122
+ """This processes the user input."""
123
+
124
+ global EGERIA_USER
125
+ global EGERIA_USER_PASSWORD
126
+ global EGERIA_PLATFORM_URL
127
+ global EGERIA_VIEW_SERVER
128
+
129
+ result = [" meow", "woof", "neigh", "hoot"]
130
+
131
+ if self.user:
132
+ result[0] = self.user
133
+ else:
134
+ result[0] = "erinoverview"
135
+ if self.password:
136
+ result[1] = self.password
137
+ else:
138
+ result[1] = "secret"
139
+ if self.platformu:
140
+ result[2] = self.platformu
141
+ else:
142
+ result[2] = "https://localhost:9443"
143
+ if self.view_server:
144
+ result[3] = self.view_server
145
+ else:
146
+ result[3] = "view-server"
147
+
148
+ # Also store the input in global variables
149
+
150
+ EGERIA_USER = result[0]
151
+ EGERIA_USER_PASSWORD = result[1]
152
+ EGERIA_PLATFORM_URL = result[2]
153
+ EGERIA_VIEW_SERVER = result[3]
154
+
155
+ await self.action_dismiss(result)
156
+
157
+ @on(Button.Pressed, "#cancel")
158
+ def on_cancel(self) -> None:
159
+ self.action_dismiss()
160
+
161
+
162
+ class ExitScreen(ModalScreen):
163
+ """App exit screen."""
164
+
165
+ DEFAULT_CSS = """
166
+ ExitScreen {
167
+ align: center middle;
168
+ }
169
+
170
+ ExitScreen > Container {
171
+ width: auto;
172
+ height: auto;
173
+ }
174
+ """
175
+
176
+ BINDINGS = [("d", "toggle_dark", "Toggle dark mode")]
177
+
178
+ def __init__(self) -> None:
179
+ """Initialize the UserInfo Screen variables"""
180
+ super().__init__()
181
+
182
+ def action_toggle_dark(self) -> None:
183
+ """An action to toggle dark mode."""
184
+ self.app.dark = not self.app.dark
185
+
186
+ def compose(self) -> ComposeResult:
187
+ with Container():
188
+ yield Label("Are you sure you want to quit?")
189
+ yield Button("No", id="no", variant="error")
190
+ yield Button("Yes", id="yes", variant="success")
191
+ yield Footer()
192
+ yield RichLog()
193
+
194
+ @on(Button.Pressed, "#no")
195
+ def on_no(self) -> None:
196
+ """No the user pressed the exit button in error"""
197
+ self.action_dismiss()
198
+
199
+ @on(Button.Pressed, "#yes")
200
+ def on_yes(self) -> None:
201
+ """Yes the user wants to quit the app"""
202
+ self.app.exit()
203
+
204
+
205
+ class Egeria_login(App):
206
+ """main app class"""
207
+
208
+ CSS_PATH = "txt_custom_v2.tcss"
209
+
210
+ BINDINGS = [("d", "toggle_dark", "Toggle dark mode")]
211
+
212
+ def __init__(self, *args, **kwargs) -> None:
213
+ super().__init__(*args, **kwargs)
214
+ dark = Reactive(True, compute=False)
215
+ self.app.dark = False
216
+ self.template: Any = None
217
+
218
+ def compose(self) -> ComposeResult:
219
+ """Compose the main display"""
220
+
221
+ yield Label(f"User: {EGERIA_USER}, password: {EGERIA_USER_PASSWORD}")
222
+ yield Label(
223
+ f"Platform: {EGERIA_PLATFORM_URL}, View Server: {EGERIA_VIEW_SERVER}"
224
+ )
225
+ yield Button("Finish", "success", id="finish")
226
+ yield RichLog()
227
+ yield Footer()
228
+
229
+ def on_button_pressed(self, event: Button.Pressed) -> (str, str, str, str):
230
+ """Yes the user wants to quit the app"""
231
+
232
+ self.exit(
233
+ (
234
+ EGERIA_USER,
235
+ EGERIA_USER_PASSWORD,
236
+ EGERIA_PLATFORM_URL,
237
+ EGERIA_VIEW_SERVER,
238
+ ),
239
+ 200,
240
+ "Finished",
241
+ )
242
+
243
+ def action_toggle_dark(self) -> None:
244
+ """An action to toggle dark and light mode."""
245
+ self.app.dark = not self.app.dark
246
+
247
+ async def on_mount(self) -> None:
248
+ """Main Program flow control start routine
249
+ Pushes the user info popup with an associated call back routine"""
250
+
251
+ global EGERIA_USER
252
+ global EGERIA_USER_PASSWORD
253
+ global EGERIA_PLATFORM_URL
254
+ global EGERIA_VIEW_SERVER
255
+
256
+ system("clear")
257
+ # Display User Info Screen
258
+ self.install_screen(UserInfo(), name="userinfo")
259
+ await self.push_screen(UserInfo(), self.input_userinfo_callback)
260
+
261
+ async def input_userinfo_callback(self, user_input) -> (str, str, str, str):
262
+ """Prompt for user id and password, callback routine
263
+ This routine is invoked when user input is completed
264
+ """
265
+
266
+ global EGERIA_USER
267
+ global EGERIA_USER_PASSWORD
268
+ global EGERIA_PLATFORM_URL
269
+ global EGERIA_VIEW_SERVER
270
+ global TECH_NAME
271
+
272
+ if user_input[0] != None:
273
+ EGERIA_USER = user_input[0]
274
+ else:
275
+ EGERIA_USER = "erinoverview"
276
+ if user_input[1] != None:
277
+ EGERIA_USER_PASSWORD = user_input[1]
278
+ else:
279
+ EGERIA_USER_PASSWORD = "secret"
280
+ if user_input[2] != None:
281
+ EGERIA_PLATFORM_URL = user_input[2]
282
+ else:
283
+ EGERIA_PLATFORM_URL = "https://localhost:9443"
284
+ if user_input[3] != None:
285
+ EGERIA_VIEW_SERVER = user_input[3]
286
+ else:
287
+ EGERIA_VIEW_SERVER = "view-server"
288
+
289
+ return (
290
+ EGERIA_USER,
291
+ EGERIA_USER_PASSWORD,
292
+ EGERIA_PLATFORM_URL,
293
+ EGERIA_VIEW_SERVER,
294
+ )
295
+
296
+
297
+ def login() -> None:
298
+ app = Egeria_login()
299
+ app.run()
300
+ return
301
+
302
+
303
+ if __name__ == "__main__":
304
+ app = Egeria_login()
305
+ app.run()
@@ -0,0 +1,19 @@
1
+ .uprompt {
2
+ width: auto;
3
+ height: auto;
4
+ }
5
+ .uimput {
6
+ border: solid white;
7
+ height: auto;
8
+ width: auto;
9
+ }
10
+ .DataTable {
11
+ color: black
12
+ }
13
+ .DataTable.Row {
14
+ width: 20%;
15
+ height: auto;
16
+ }
17
+ #table {
18
+ color: black
19
+ }
@@ -40,6 +40,31 @@ def base_path(client, view_server: str):
40
40
  return f"{client.platform_url}/servers/{view_server}/api/open-metadata/metadata-explorer"
41
41
 
42
42
 
43
+ def process_related_element_list(response: Response, mermaid_only: bool) -> str | dict:
44
+ """Process the result payload
45
+
46
+ Parameters
47
+ ----------
48
+ response
49
+ mermaid_only
50
+
51
+ Returns
52
+ -------
53
+
54
+ """
55
+ elements = response.json().get("relatedElementList", "No elements found")
56
+ if isinstance(elements, str):
57
+ return "No elements found"
58
+ el_list = elements.get("elementList", "No elements found")
59
+ if isinstance(el_list, str):
60
+ return el_list
61
+ if mermaid_only:
62
+ return elements.get("mermaidGraph", "No mermaid graph found")
63
+ if len(el_list) == 0:
64
+ return "No elements returned"
65
+ return elements
66
+
67
+
43
68
  class MetadataExplorer(Client):
44
69
  """MetadataExplorer is a class that extends the Client class. The Metadata Explorer OMVS provides APIs for
45
70
  supporting the search, query and retrieval of open metadata. It is an advanced API for users that understands
@@ -319,6 +344,7 @@ class MetadataExplorer(Client):
319
344
  as_of_time: str = None,
320
345
  for_lineage: bool = None,
321
346
  for_duplicate_processing: bool = None,
347
+ mermaid_only: bool = False,
322
348
  ) -> dict | str:
323
349
  """
324
350
  Retrieve the metadata element and all of its anchored elements using its unique identifier. Async version.
@@ -335,11 +361,15 @@ class MetadataExplorer(Client):
335
361
  - determines if elements classified as Memento should be returned - normally false
336
362
  for_duplicate_processing: bool, default is set by server
337
363
  - Normally false. Set true when the caller is part of a deduplication function
364
+ mermaid_only: bool, default is False
365
+ - if true only a string representing the mermaid graph will be returned
338
366
 
339
367
  Returns
340
368
  -------
341
369
  dict | str
342
- If the element is found, a dict of the element details is returned. Otherwise the string "No element found".
370
+ If the element is found, and mermaid_only is False, a dict of the element details is returned.
371
+ If mermaid_only is True, a string representing the mermaid graph will be returned.
372
+ If no elements found, string "No element found".
343
373
 
344
374
  Raises
345
375
  ------
@@ -371,7 +401,22 @@ class MetadataExplorer(Client):
371
401
  response: Response = await self._async_make_request(
372
402
  "POST", url, body_slimmer(body)
373
403
  )
374
- return response.json().get("elementGraph", "No elements found")
404
+ # if mermaid_only:
405
+ # return response.json()["elementGraph"].get(
406
+ # "mermaidGraph", "No elements found"
407
+ # )
408
+ # else:
409
+ # return response.json().get("elementGraph", "No elements found")
410
+ if isinstance(response, str):
411
+ return "No elements found"
412
+ el_list = response.json().get("elementGraph", "No elements found")
413
+ if isinstance(el_list, str):
414
+ return el_list
415
+ if mermaid_only:
416
+ return el_list.get("mermaidGraph", "No mermaid graph found")
417
+ if len(el_list) == 0:
418
+ return "No elements returned"
419
+ return el_list
375
420
 
376
421
  def get_metadata_element_graph(
377
422
  self,
@@ -380,9 +425,10 @@ class MetadataExplorer(Client):
380
425
  as_of_time: str = None,
381
426
  for_lineage: bool = None,
382
427
  for_duplicate_processing: bool = None,
428
+ mermaid_only: bool = False,
383
429
  ) -> dict | str:
384
430
  """
385
- Retrieve the metadata element using its unique identifier.
431
+ Retrieve the metadata element and all of its anchored elements using its unique identifier. Async version.
386
432
 
387
433
  Parameters
388
434
  ----------
@@ -396,11 +442,15 @@ class MetadataExplorer(Client):
396
442
  - determines if elements classified as Memento should be returned - normally false
397
443
  for_duplicate_processing: bool, default is set by server
398
444
  - Normally false. Set true when the caller is part of a deduplication function
445
+ mermaid_only: bool, default is False
446
+ - if true only a string representing the mermaid graph will be returned
399
447
 
400
448
  Returns
401
449
  -------
402
450
  dict | str
403
- If the element is found, a dict of the element details is returned. Otherwise the string "No element found".
451
+ If the element is found, and mermaid_only is False, a dict of the element details is returned.
452
+ If mermaid_only is True, a string representing the mermaid graph will be returned.
453
+ If no elements found, string "No element found".
404
454
 
405
455
  Raises
406
456
  ------
@@ -415,54 +465,59 @@ class MetadataExplorer(Client):
415
465
  loop = asyncio.get_event_loop()
416
466
  response = loop.run_until_complete(
417
467
  self._async_get_metadata_element_graph(
418
- guid, effective_time, as_of_time, for_lineage, for_duplicate_processing
468
+ guid,
469
+ effective_time,
470
+ as_of_time,
471
+ for_lineage,
472
+ for_duplicate_processing,
473
+ mermaid_only,
419
474
  )
420
475
  )
421
476
  return response
422
477
 
423
- def get_metadata_element_mermaid_graph(
424
- self,
425
- guid: str,
426
- effective_time: str = None,
427
- as_of_time: str = None,
428
- for_lineage: bool = None,
429
- for_duplicate_processing: bool = None,
430
- ) -> dict | str:
431
- """
432
- Retrieve the metadata element using its unique identifier.
433
-
434
- Parameters
435
- ----------
436
- guid : str
437
- - unique identifier of the element to retrieve
438
- effective_time: str, default = None
439
- - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
440
- as_of_time: str, default = None
441
- - Query the element as of this time. If None, then use current time.
442
- for_lineage: bool, default is set by server
443
- - determines if elements classified as Memento should be returned - normally false
444
- for_duplicate_processing: bool, default is set by server
445
- - Normally false. Set true when the caller is part of a deduplication function
446
-
447
- Returns
448
- -------
449
- dict | str
450
- If the element is found, a dict of the element details is returned. Otherwise the string "No element found".
451
-
452
- Raises
453
- ------
454
- InvalidParameterException
455
- one of the parameters is null or invalid or
456
- PropertyServerException
457
- There is a problem adding the element properties to the metadata repository or
458
- UserNotAuthorizedException
459
- the requesting user is not authorized to issue this request.
460
- """
461
-
462
- response = self.get_metadata_element_graph(
463
- guid, effective_time, as_of_time, for_lineage, for_duplicate_processing
464
- )
465
- return response.get("mermaidGraph", "No elements found")
478
+ # def get_metadata_element_mermaid_graph(
479
+ # self,
480
+ # guid: str,
481
+ # effective_time: str = None,
482
+ # as_of_time: str = None,
483
+ # for_lineage: bool = None,
484
+ # for_duplicate_processing: bool = None,
485
+ # ) -> dict | str:
486
+ # """
487
+ # Retrieve the metadata element using its unique identifier.
488
+ #
489
+ # Parameters
490
+ # ----------
491
+ # guid : str
492
+ # - unique identifier of the element to retrieve
493
+ # effective_time: str, default = None
494
+ # - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
495
+ # as_of_time: str, default = None
496
+ # - Query the element as of this time. If None, then use current time.
497
+ # for_lineage: bool, default is set by server
498
+ # - determines if elements classified as Memento should be returned - normally false
499
+ # for_duplicate_processing: bool, default is set by server
500
+ # - Normally false. Set true when the caller is part of a deduplication function
501
+ #
502
+ # Returns
503
+ # -------
504
+ # dict | str
505
+ # If the element is found, a dict of the element details is returned. Otherwise the string "No element found".
506
+ #
507
+ # Raises
508
+ # ------
509
+ # InvalidParameterException
510
+ # one of the parameters is null or invalid or
511
+ # PropertyServerException
512
+ # There is a problem adding the element properties to the metadata repository or
513
+ # UserNotAuthorizedException
514
+ # the requesting user is not authorized to issue this request.
515
+ # """
516
+ #
517
+ # response = self.get_metadata_element_graph(
518
+ # guid, effective_time, as_of_time, for_lineage, for_duplicate_processing
519
+ # )
520
+ # return response.get("mermaidGraph", "No elements found")
466
521
 
467
522
  async def _async_get_metadata_element_by_unique_name(
468
523
  self,
@@ -897,6 +952,7 @@ class MetadataExplorer(Client):
897
952
  start_from: int = 0,
898
953
  page_size: int = max_paging_size,
899
954
  time_out: int = default_time_out,
955
+ mermaid_only: bool = False,
900
956
  ) -> list | str:
901
957
  """
902
958
  Retrieve the metadata elements connected to the supplied element.
@@ -920,6 +976,9 @@ class MetadataExplorer(Client):
920
976
  - maximum number of elements to return.
921
977
  time_out: int, default = default_time_out
922
978
  - http request timeout for this request
979
+ mermaid_only: bool, default is False
980
+ - if true only a string representing the mermaid graph will be returned
981
+
923
982
 
924
983
  Returns
925
984
  -------
@@ -967,12 +1026,7 @@ class MetadataExplorer(Client):
967
1026
  response: Response = await self._async_make_request(
968
1027
  "POST", url, body_slimmer(body), time_out=time_out
969
1028
  )
970
-
971
- elements = response.json().get("elementList", "No elements found")
972
- if type(elements) is list:
973
- if len(elements) == 0:
974
- return "No elements found"
975
- return elements
1029
+ return process_related_element_list(response, mermaid_only)
976
1030
 
977
1031
  def get_all_related_metadata_elements(
978
1032
  self,
@@ -984,6 +1038,7 @@ class MetadataExplorer(Client):
984
1038
  start_from: int = 0,
985
1039
  page_size: int = max_paging_size,
986
1040
  time_out: int = default_time_out,
1041
+ mermaid_only: bool = False,
987
1042
  ) -> list | str:
988
1043
  """
989
1044
  Retrieve the metadata elements connected to the supplied element.
@@ -1006,6 +1061,9 @@ class MetadataExplorer(Client):
1006
1061
  - maximum number of elements to return.
1007
1062
  time_out: int, default = default_time_out
1008
1063
  - http request timeout for this request
1064
+ mermaid_only: bool, default is False
1065
+ - if true only a string representing the mermaid graph will be returned
1066
+
1009
1067
 
1010
1068
  Returns
1011
1069
  -------
@@ -1045,6 +1103,7 @@ class MetadataExplorer(Client):
1045
1103
  start_from,
1046
1104
  page_size,
1047
1105
  time_out,
1106
+ mermaid_only,
1048
1107
  )
1049
1108
  )
1050
1109
  return response
@@ -1060,6 +1119,7 @@ class MetadataExplorer(Client):
1060
1119
  start_from: int = 0,
1061
1120
  page_size: int = max_paging_size,
1062
1121
  time_out: int = default_time_out,
1122
+ mermaid_only: bool = False,
1063
1123
  ) -> list | str:
1064
1124
  """
1065
1125
  Retrieve the metadata elements connected to the supplied element.
@@ -1085,6 +1145,8 @@ class MetadataExplorer(Client):
1085
1145
  - maximum number of elements to return.
1086
1146
  time_out: int, default = default_time_out
1087
1147
  - http request timeout for this request
1148
+ mermaid_only: bool, default is False
1149
+ - if true only a string representing the mermaid graph will be returned
1088
1150
 
1089
1151
  Returns
1090
1152
  -------
@@ -1133,11 +1195,7 @@ class MetadataExplorer(Client):
1133
1195
  "POST", url, body_slimmer(body), time_out=time_out
1134
1196
  )
1135
1197
 
1136
- elements = response.json().get("elementList", "No elements found")
1137
- if type(elements) is list:
1138
- if len(elements) == 0:
1139
- return "No elements found"
1140
- return elements
1198
+ return process_related_element_list(response, mermaid_only)
1141
1199
 
1142
1200
  def get_related_metadata_elements(
1143
1201
  self,
@@ -1150,6 +1208,7 @@ class MetadataExplorer(Client):
1150
1208
  start_from: int = 0,
1151
1209
  page_size: int = max_paging_size,
1152
1210
  time_out: int = default_time_out,
1211
+ mermaid_only: bool = False,
1153
1212
  ) -> list | str:
1154
1213
  """
1155
1214
  Retrieve the metadata elements connected to the supplied element.
@@ -1174,6 +1233,8 @@ class MetadataExplorer(Client):
1174
1233
  - maximum number of elements to return.
1175
1234
  time_out: int, default = default_time_out
1176
1235
  - http request timeout for this request
1236
+ mermaid_only: bool, default is False
1237
+ - if true only a string representing the mermaid graph will be returned
1177
1238
 
1178
1239
  Returns
1179
1240
  -------
@@ -1214,6 +1275,7 @@ class MetadataExplorer(Client):
1214
1275
  start_from,
1215
1276
  page_size,
1216
1277
  time_out,
1278
+ mermaid_only,
1217
1279
  )
1218
1280
  )
1219
1281
  return response
@@ -1229,6 +1291,7 @@ class MetadataExplorer(Client):
1229
1291
  start_from: int = 0,
1230
1292
  page_size: int = max_paging_size,
1231
1293
  time_out: int = default_time_out,
1294
+ mermaid_only: bool = False,
1232
1295
  ) -> list | str:
1233
1296
  """
1234
1297
  Retrieve the relationships linking the supplied elements.
@@ -1254,6 +1317,9 @@ class MetadataExplorer(Client):
1254
1317
  - maximum number of elements to return.
1255
1318
  time_out: int, default = default_time_out
1256
1319
  - http request timeout for this request
1320
+ mermaid_only: bool, default is False
1321
+ - if true only a string representing the mermaid graph will be returned
1322
+
1257
1323
 
1258
1324
  Returns
1259
1325
  -------
@@ -1303,11 +1369,7 @@ class MetadataExplorer(Client):
1303
1369
  "POST", url, body_slimmer(body), time_out=time_out
1304
1370
  )
1305
1371
 
1306
- elements = response.json().get("elementList", "No elements found")
1307
- if type(elements) is list:
1308
- if len(elements) == 0:
1309
- return "No elements found"
1310
- return elements
1372
+ return process_related_element_list(response, mermaid_only)
1311
1373
 
1312
1374
  def get_all_metadata_element_relationships(
1313
1375
  self,
@@ -1320,6 +1382,7 @@ class MetadataExplorer(Client):
1320
1382
  start_from: int = 0,
1321
1383
  page_size: int = max_paging_size,
1322
1384
  time_out: int = default_time_out,
1385
+ mermaid_only: bool = False,
1323
1386
  ) -> list | str:
1324
1387
  """
1325
1388
  Retrieve the relationships linking the supplied elements.
@@ -1344,6 +1407,8 @@ class MetadataExplorer(Client):
1344
1407
  - maximum number of elements to return.
1345
1408
  time_out: int, default = default_time_out
1346
1409
  - http request timeout for this request
1410
+ mermaid_only: bool, default is False
1411
+ - if true only a string representing the mermaid graph will be returned
1347
1412
 
1348
1413
  Returns
1349
1414
  -------
@@ -1384,6 +1449,7 @@ class MetadataExplorer(Client):
1384
1449
  start_from,
1385
1450
  page_size,
1386
1451
  time_out,
1452
+ mermaid_only,
1387
1453
  )
1388
1454
  )
1389
1455
  return response
@@ -1400,6 +1466,7 @@ class MetadataExplorer(Client):
1400
1466
  start_from: int = 0,
1401
1467
  page_size: int = max_paging_size,
1402
1468
  time_out: int = default_time_out,
1469
+ mermaid_only: bool = False,
1403
1470
  ) -> list | str:
1404
1471
  """
1405
1472
  Retrieve the relationships linking the supplied elements.
@@ -1427,6 +1494,8 @@ class MetadataExplorer(Client):
1427
1494
  - maximum number of elements to return.
1428
1495
  time_out: int, default = default_time_out
1429
1496
  - http request timeout for this request
1497
+ mermaid_only: bool, default is False
1498
+ - if true only a string representing the mermaid graph will be returned
1430
1499
 
1431
1500
  Returns
1432
1501
  -------
@@ -1476,11 +1545,7 @@ class MetadataExplorer(Client):
1476
1545
  "POST", url, body_slimmer(body), time_out=time_out
1477
1546
  )
1478
1547
 
1479
- elements = response.json().get("elementList", "No elements found")
1480
- if type(elements) is list:
1481
- if len(elements) == 0:
1482
- return "No elements found"
1483
- return elements
1548
+ return process_related_element_list(response, mermaid_only)
1484
1549
 
1485
1550
  def get_metadata_element_relationships(
1486
1551
  self,
@@ -1494,6 +1559,7 @@ class MetadataExplorer(Client):
1494
1559
  start_from: int = 0,
1495
1560
  page_size: int = max_paging_size,
1496
1561
  time_out: int = default_time_out,
1562
+ mermaid_only: bool = False,
1497
1563
  ) -> list | str:
1498
1564
  """
1499
1565
  Retrieve the relationships linking the supplied elements.
@@ -1520,6 +1586,9 @@ class MetadataExplorer(Client):
1520
1586
  - maximum number of elements to return.
1521
1587
  time_out: int, default = default_time_out
1522
1588
  - http request timeout for this request
1589
+ mermaid_only: bool, default is False
1590
+ - if true only a string representing the mermaid graph will be returned
1591
+
1523
1592
 
1524
1593
  Returns
1525
1594
  -------
@@ -1561,6 +1630,7 @@ class MetadataExplorer(Client):
1561
1630
  start_from,
1562
1631
  page_size,
1563
1632
  time_out,
1633
+ mermaid_only,
1564
1634
  )
1565
1635
  )
1566
1636
  return response
@@ -2098,6 +2168,7 @@ class MetadataExplorer(Client):
2098
2168
  start_from: int = 0,
2099
2169
  page_size: int = max_paging_size,
2100
2170
  time_out: int = default_time_out,
2171
+ mermaid_only: bool = False,
2101
2172
  ) -> list | str:
2102
2173
  """
2103
2174
  Retrieve all the versions of a relationship. Async version.
@@ -2123,6 +2194,8 @@ class MetadataExplorer(Client):
2123
2194
  - maximum number of elements to return.
2124
2195
  time_out: int, default = default_time_out
2125
2196
  - http request timeout for this request
2197
+ mermaid_only: bool, default is False
2198
+ - if true only a string representing the mermaid graph will be returned
2126
2199
 
2127
2200
  Returns
2128
2201
  -------
@@ -2164,12 +2237,11 @@ class MetadataExplorer(Client):
2164
2237
  response: Response = await self._async_make_request(
2165
2238
  "POST", url, body_slimmer(body), time_out=time_out
2166
2239
  )
2167
-
2168
- elements = response.json().get("elementList", "No elements found")
2169
- if type(elements) is list:
2170
- if len(elements) == 0:
2171
- return "No elements found"
2172
- return elements
2240
+ rel = response.json().get("relationshipList", "No elements found")
2241
+ if isinstance(rel, (list, dict)):
2242
+ return rel.get("elementList", "No elements found")
2243
+ else:
2244
+ return rel
2173
2245
 
2174
2246
  def get_relationship_history(
2175
2247
  self,
@@ -2183,6 +2255,7 @@ class MetadataExplorer(Client):
2183
2255
  start_from: int = 0,
2184
2256
  page_size: int = max_paging_size,
2185
2257
  time_out: int = default_time_out,
2258
+ mermaid_only: bool = False,
2186
2259
  ) -> list | str:
2187
2260
  """
2188
2261
  Retrieve all the versions of a relationship.
@@ -2208,6 +2281,8 @@ class MetadataExplorer(Client):
2208
2281
  - maximum number of elements to return.
2209
2282
  time_out: int, default = default_time_out
2210
2283
  - http request timeout for this request
2284
+ mermaid_only: bool, default is False
2285
+ - if true only a string representing the mermaid graph will be returned
2211
2286
 
2212
2287
  Returns
2213
2288
  -------
@@ -2237,6 +2312,7 @@ class MetadataExplorer(Client):
2237
2312
  start_from,
2238
2313
  page_size,
2239
2314
  time_out,
2315
+ mermaid_only,
2240
2316
  )
2241
2317
  )
2242
2318
  return response
@@ -1421,7 +1421,7 @@ class ValidMetadataManager(Client):
1421
1421
  url = f"{self.platform_url}/servers/{self.view_server}{self.valid_m_command_base}/open-metadata-types"
1422
1422
 
1423
1423
  resp = await self._async_make_request("GET", url)
1424
- return resp.json().get("typeDefs", "No TypeDefs Found")
1424
+ return resp.json()
1425
1425
 
1426
1426
  def get_all_entity_types(self) -> list | str:
1427
1427
  """Returns the list of different types of metadata organized into two groups. The first are the
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 5.2.0.9
3
+ Version: 5.2.0.12
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -34,12 +34,14 @@ pyegeria/commands/cat/list_terms.py,sha256=yq3kyfCZ6Hfbqc30L6o-b3Ebp6NpywD99KL4k
34
34
  pyegeria/commands/cat/list_todos.py,sha256=iPxHRyW3X5tiREio4TUOwRPvNPjU0gxm3pVnUI79ir4,6542
35
35
  pyegeria/commands/cat/list_user_ids.py,sha256=7JinL7rknPbGusIb8ikXKEaV1vvbuvx_WWtbmlfS_DY,5093
36
36
  pyegeria/commands/cli/__init__.py,sha256=hpTVSMP2gnPRhcAZPdeUEsQ-eaDySlXlk239dNWYmng,292
37
- pyegeria/commands/cli/egeria.py,sha256=ph-22mMPsq9HV2MTp4H_CDx_oteB9oK1TnVEgiAVCGs,45021
37
+ pyegeria/commands/cli/egeria.py,sha256=3vkFV1wkRawWGF4I9O-dC9V7fsYXx_4-Gnx_oa8OJb0,45150
38
38
  pyegeria/commands/cli/egeria_cat.py,sha256=xsLz1cLvVzh6EV-oz2Ou01KroQ5g3yRKP7FCtvpD5SA,16069
39
+ pyegeria/commands/cli/egeria_login_tui.py,sha256=gYO2DAbWCfzDvUgqTiddpw9LXiqKr8bCIGBbpHgfSCk,9009
39
40
  pyegeria/commands/cli/egeria_my.py,sha256=H7QO9pRjH0nOghsGev4Cu3DCjp-UkRrV6_tl5npwRlI,5851
40
41
  pyegeria/commands/cli/egeria_ops.py,sha256=bHH3pFnw9jc6aSvnbafsM6ch0juI7WSZwREnMKB-I4Q,12241
41
42
  pyegeria/commands/cli/egeria_tech.py,sha256=jntbc-TZqu8qGK-MScQNUbRdRLjV_8J-B-JOaaCu6MU,15015
42
43
  pyegeria/commands/cli/ops_config.py,sha256=-fTndSzs1zDmWwKk8hu6FMtBwOyXrZKpIemgykhpigI,1379
44
+ pyegeria/commands/cli/txt_custom_v2.tcss,sha256=ixkzpFyTZ5i3byFO9EmEAeJgzbEa7nZb_3iTgxNtVPk,232
43
45
  pyegeria/commands/doc/Visual Command Reference/cat/show/assets/Asset-graph 2024-11-20 at 15.56.42.png,sha256=gL7LDmS0OUeDmmmz6ayZL7qbriaos6ryct-2T0D7CIM,769210
44
46
  pyegeria/commands/doc/Visual Command Reference/cat/show/assets/Assets-in-domain 2024-11-20 at 15.49.55@2x.png,sha256=Op6NHsqPfYVvpKX46Z-IX8G_Of8rrVtDK34C1MJIJdw,540605
45
47
  pyegeria/commands/doc/Visual Command Reference/cat/show/assets/deployed-catalogs 2024-11-20 at 16.17.43@2x.png,sha256=MUgoH6orUk9qUeCv8yEjuQ6sAao3eZyK3DOF4aXfqkw,525598
@@ -52,6 +54,8 @@ pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot
52
54
  pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-25 at 20.36.42@2x.png,sha256=ki-tG_CkXAa-SGajxkfkwHPaOw2uipUKYRf9H86FB_k,27874
53
55
  pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-25 at 20.36.55@2x.png,sha256=Y3XWP5RB8tY93ChiAHEGU1oc-o5O-3RRoAIs9SnHdLc,98769
54
56
  pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-11-25 at 20.37.07@2x.png,sha256=pJZ0Yz5bXAadZasEBzUTxFy_VRB216saLD6OkyjnOWQ,455058
57
+ pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-12-06 at 08.46.30@2x.png,sha256=IbIpTsOAKt-TyvH-_tTG9_jemENgeVZ5QIoMuVLhHFo,950898
58
+ pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/CleanShot 2024-12-06 at 11.27.56@2x.png,sha256=PZKjjJIht9SUouRNu5m5gNmc62mI0BXycnS7GLCbLxA,337971
55
59
  pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/catalogs 2024-11-25 at 16.28.53@2x.png,sha256=VXRq9sOKApd5Vm1w5GwABI4RJM1V50R8S_rjQfNV3QI,171649
56
60
  pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs-2024-11-20 at 16.17.43@2x.png,sha256=MUgoH6orUk9qUeCv8yEjuQ6sAao3eZyK3DOF4aXfqkw,525598
57
61
  pyegeria/commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-11-25 at 20.14.50@2x.png,sha256=W6_JDqWKBOqeEMTAteX7JJ_MIPOigc2ttD01UYBxNxg,443831
@@ -173,7 +177,7 @@ pyegeria/full_omag_server_config.py,sha256=k3fUfopAFAE3OKkFR7zZPiki_FYj6j2xQ4oD2
173
177
  pyegeria/glossary_browser_omvs.py,sha256=NcitYaZJqwVODBO5zBtWpXPNUJJ3DKzEbRaOFSAyUlg,93554
174
178
  pyegeria/glossary_manager_omvs.py,sha256=SWgPGkRag5hOXYM-cpbWI6oW_DXUZBt4ePtmOP7ZYUc,128787
175
179
  pyegeria/mermaid_utilities.py,sha256=GXiS-subb5nJcDqlThZWX2T8WspU1neFfhf4TxRoMh4,8344
176
- pyegeria/metadata_explorer_omvs.py,sha256=519Im5lyO0JaFqAr1xxQcPJ3jYMtC8OYXmh4Gj6DBPs,82282
180
+ pyegeria/metadata_explorer_omvs.py,sha256=1Uf8xlRx440hRmUZxvRJHbUBQeuZgsL31j9D_1J3o9Y,85615
177
181
  pyegeria/my_profile_omvs.py,sha256=DyECbUFEcgokrIbzdMMNljC3bqfqKGXAF2wZEpzvRYs,34666
178
182
  pyegeria/platform_services.py,sha256=CJIOYIFEbcIGwdWlApAQcXxZTsdrhFtpJcm4O3p7dG0,41646
179
183
  pyegeria/project_manager_omvs.py,sha256=Y7Lyqh4jIujJrr_Ub7feo904FN_uz4R10T4hKhqE1Uw,67499
@@ -182,10 +186,10 @@ pyegeria/runtime_manager_omvs.py,sha256=ygrY5I_oSoJQun05W7wSNbZT_nOtPp_BkIKKFCLF
182
186
  pyegeria/server_operations.py,sha256=ciH890hYT85YQ6OpByn4w7s3a7TtvWZpIG5rkRqbcI0,16766
183
187
  pyegeria/template_manager_omvs.py,sha256=heqbKeum5hPCHap4r1RUZU8YB3QaQlxVNbq4GZimJtE,42450
184
188
  pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
185
- pyegeria/valid_metadata_omvs.py,sha256=tfCGXed5LLt59YA8uZNNtd9UJ-lRZfPU_uZxK31Yux0,65069
189
+ pyegeria/valid_metadata_omvs.py,sha256=kmcyXBsu99L25r16w9xVXqU_KwADsGuft4yPDZzyUds,65032
186
190
  pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
187
- pyegeria-5.2.0.9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
188
- pyegeria-5.2.0.9.dist-info/METADATA,sha256=CK5MUg-H1pbtTDLxSY95cpD8_R8gj8y9CcnwzZ-IjHc,2879
189
- pyegeria-5.2.0.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
190
- pyegeria-5.2.0.9.dist-info/entry_points.txt,sha256=JhYgb02izlV2wb7SIfCOMxeVISUd9YJvgDW1-kuHad4,5240
191
- pyegeria-5.2.0.9.dist-info/RECORD,,
191
+ pyegeria-5.2.0.12.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
192
+ pyegeria-5.2.0.12.dist-info/METADATA,sha256=kP5UPxsrjIBXSzlN332jUw3X51Ctd2v80s9ICahUCWs,2880
193
+ pyegeria-5.2.0.12.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
194
+ pyegeria-5.2.0.12.dist-info/entry_points.txt,sha256=JhYgb02izlV2wb7SIfCOMxeVISUd9YJvgDW1-kuHad4,5240
195
+ pyegeria-5.2.0.12.dist-info/RECORD,,