pyegeria 0.7.45.1__py3-none-any.whl → 0.8.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. examples/widgets/cat/list_cert_types.py +61 -43
  2. examples/widgets/cat/list_projects.py +1 -1
  3. examples/widgets/my/my_profile_actions.py +51 -32
  4. examples/widgets/ops/engine_actions.py +35 -23
  5. examples/widgets/ops/integration_daemon_actions.py +51 -32
  6. examples/widgets/tech/get_element_info.py +63 -38
  7. examples/widgets/tech/get_guid_info.py +50 -27
  8. examples/widgets/tech/list_asset_types.py +33 -23
  9. examples/widgets/tech/list_elements.py +44 -34
  10. examples/widgets/tech/list_elements_x.py +69 -49
  11. examples/widgets/tech/list_registered_services.py +44 -24
  12. examples/widgets/tech/list_related_specification.py +70 -45
  13. examples/widgets/tech/list_relationship_types.py +50 -31
  14. examples/widgets/tech/list_valid_metadata_values.py +57 -28
  15. examples/widgets/tech/x_list_related_elements.py +54 -34
  16. pyegeria/Xloaded_resources_omvs.py +43 -41
  17. pyegeria/__init__.py +6 -2
  18. pyegeria/_client.py +142 -102
  19. pyegeria/_deprecated_gov_engine.py +218 -167
  20. pyegeria/action_author_omvs.py +107 -88
  21. pyegeria/asset_catalog_omvs.py +467 -395
  22. pyegeria/automated_curation_omvs.py +2 -2
  23. pyegeria/classification_manager_omvs.py +3 -9
  24. pyegeria/collection_manager_omvs.py +1957 -1519
  25. pyegeria/core_omag_server_config.py +310 -192
  26. pyegeria/egeria_cat_client.py +88 -0
  27. pyegeria/egeria_config_client.py +37 -0
  28. pyegeria/egeria_my_client.py +47 -0
  29. pyegeria/egeria_ops_client.py +67 -0
  30. pyegeria/egeria_tech_client.py +77 -0
  31. pyegeria/feedback_manager_omvs.py +633 -631
  32. pyegeria/full_omag_server_config.py +330 -158
  33. pyegeria/glossary_browser_omvs.py +927 -474
  34. pyegeria/glossary_manager_omvs.py +1033 -543
  35. pyegeria/my_profile_omvs.py +714 -574
  36. pyegeria/platform_services.py +228 -176
  37. pyegeria/project_manager_omvs.py +1158 -903
  38. pyegeria/registered_info.py +76 -74
  39. pyegeria/runtime_manager_omvs.py +749 -670
  40. pyegeria/server_operations.py +123 -85
  41. pyegeria/valid_metadata_omvs.py +268 -168
  42. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.1.dist-info}/METADATA +1 -1
  43. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.1.dist-info}/RECORD +46 -42
  44. pyegeria/tech_guids_31-08-2024 14:33.py +0 -79
  45. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.1.dist-info}/LICENSE +0 -0
  46. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.1.dist-info}/WHEEL +0 -0
  47. {pyegeria-0.7.45.1.dist-info → pyegeria-0.8.1.dist-info}/entry_points.txt +0 -0
@@ -14,33 +14,42 @@ from pyegeria import (
14
14
  PropertyServerException,
15
15
  UserNotAuthorizedException,
16
16
  print_exception_response,
17
- ClassificationManager, FeedbackManager
17
+ ClassificationManager,
18
+ FeedbackManager,
18
19
  )
19
20
 
20
21
 
21
22
  console = Console()
22
23
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
23
- EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
24
- EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
25
- EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
26
- EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
27
- EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
28
- EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
29
- EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
30
- EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
31
- EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
32
- EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
33
- EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
34
-
35
-
36
-
37
- def list_elements_x(om_type:str, server: str,
38
- url: str, username: str, password: str, jupyter:bool=EGERIA_JUPYTER, width:int = EGERIA_WIDTH
24
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
25
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
26
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
27
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
28
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
29
+ )
30
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
31
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
32
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
33
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
34
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
35
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
36
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
37
+
38
+
39
+ def list_elements_x(
40
+ om_type: str,
41
+ server: str,
42
+ url: str,
43
+ username: str,
44
+ password: str,
45
+ jupyter: bool = EGERIA_JUPYTER,
46
+ width: int = EGERIA_WIDTH,
39
47
  ):
40
-
41
48
  c_client = ClassificationManager(server, url, user_id=username, user_pwd=password)
42
49
  token = c_client.create_egeria_bearer_token()
43
- f_client = FeedbackManager(server, url, user_id=username, user_pwd=password, token=token)
50
+ f_client = FeedbackManager(
51
+ server, url, user_id=username, user_pwd=password, token=token
52
+ )
44
53
 
45
54
  elements = c_client.get_elements(om_type)
46
55
 
@@ -57,30 +66,29 @@ def list_elements_x(om_type:str, server: str,
57
66
  box=box.ROUNDED,
58
67
  title=f"Elements for Open Metadata Type: '{om_type}' ",
59
68
  expand=True,
60
- width=width
69
+ width=width,
61
70
  )
62
71
 
63
72
  table.add_column("Qualified Name")
64
73
  table.add_column("Type")
65
74
  table.add_column("Created")
66
75
  table.add_column("Home Store")
67
- table.add_column("GUID", width = 38,no_wrap=True)
76
+ table.add_column("GUID", width=38, no_wrap=True)
68
77
  table.add_column("Properties")
69
- table.add_column('Feedback', min_width=30)
70
- table.add_column('Public Comments')
71
-
78
+ table.add_column("Feedback", min_width=30)
79
+ table.add_column("Public Comments")
72
80
 
73
81
  if type(elements) is list:
74
82
  for element in elements:
75
- header = element['elementHeader']
76
- el_q_name = element['properties'].get('qualifiedName',"---")
77
- el_type = header["type"]['typeName']
78
- el_home = header['origin']['homeMetadataCollectionName']
79
- el_create_time = header['versions']['createTime'][:-18]
80
- el_guid = header['guid']
83
+ header = element["elementHeader"]
84
+ el_q_name = element["properties"].get("qualifiedName", "---")
85
+ el_type = header["type"]["typeName"]
86
+ el_home = header["origin"]["homeMetadataCollectionName"]
87
+ el_create_time = header["versions"]["createTime"][:-18]
88
+ el_guid = header["guid"]
81
89
 
82
90
  el_props_md = ""
83
- for prop in element['properties'].keys():
91
+ for prop in element["properties"].keys():
84
92
  el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
85
93
 
86
94
  el_props_out = Markdown(el_props_md)
@@ -89,34 +97,43 @@ def list_elements_x(om_type:str, server: str,
89
97
  tags_md = "Tags:\n"
90
98
  if type(tags) is list:
91
99
  for tag in tags:
92
- tags_md += (f"* tag: {tag.get('name','---')}\n"
93
- f"\t description: {tag.get('description','---')}\n"
94
- f"\t assigned by: {tag.get('user','---')}\n"
95
- )
100
+ tags_md += (
101
+ f"* tag: {tag.get('name','---')}\n"
102
+ f"\t description: {tag.get('description','---')}\n"
103
+ f"\t assigned by: {tag.get('user','---')}\n"
104
+ )
96
105
 
97
106
  else:
98
107
  tags_md = "---"
99
108
 
100
-
101
109
  likes = f_client.get_attached_likes(el_guid)
102
110
  likes_md = "Likes:\b"
103
111
  if type(likes) is list:
104
112
  for like in likes:
105
- likes_md += (f"* tag: {like['name']}\n"
106
- f"* description: {like['description']}\n"
107
- f"* assigned by: {like['user']}\n"
108
- f"\n")
113
+ likes_md += (
114
+ f"* tag: {like['name']}\n"
115
+ f"* description: {like['description']}\n"
116
+ f"* assigned by: {like['user']}\n"
117
+ f"\n"
118
+ )
109
119
 
110
120
  else:
111
121
  likes_md = "---"
112
122
 
113
-
114
123
  feedback_out = f"{tags_md}\n --- \n{likes_md}"
115
124
 
116
125
  comments_out = " "
117
126
 
118
-
119
- table.add_row(el_q_name, el_type, el_create_time, el_home, el_guid, el_props_out, feedback_out, comments_out)
127
+ table.add_row(
128
+ el_q_name,
129
+ el_type,
130
+ el_create_time,
131
+ el_home,
132
+ el_guid,
133
+ el_props_out,
134
+ feedback_out,
135
+ comments_out,
136
+ )
120
137
 
121
138
  return table
122
139
  else:
@@ -129,7 +146,11 @@ def list_elements_x(om_type:str, server: str,
129
146
  with console.pager(styles=True):
130
147
  console.print(generate_table())
131
148
 
132
- except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
149
+ except (
150
+ InvalidParameterException,
151
+ PropertyServerException,
152
+ UserNotAuthorizedException,
153
+ ) as e:
133
154
  print_exception_response(e)
134
155
  print("\n\nPerhaps the type name isn't known")
135
156
  finally:
@@ -151,14 +172,13 @@ def main():
151
172
  password = args.password if args.password is not None else EGERIA_USER_PASSWORD
152
173
 
153
174
  try:
154
- om_type = Prompt.ask("Enter the Open Metadata Type to find elements of:", default="GlossaryTerm")
175
+ om_type = Prompt.ask(
176
+ "Enter the Open Metadata Type to find elements of:", default="GlossaryTerm"
177
+ )
155
178
  list_elements_x(om_type, server, url, userid, password)
156
- except(KeyboardInterrupt):
179
+ except KeyboardInterrupt:
157
180
  pass
158
181
 
159
182
 
160
183
  if __name__ == "__main__":
161
184
  main()
162
-
163
-
164
-
@@ -25,23 +25,31 @@ from pyegeria import (
25
25
  )
26
26
 
27
27
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
28
- EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
29
- EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
30
- EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
31
- EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
32
- EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
33
- EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
34
- EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
35
- EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
36
- EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
37
- EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
38
- EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
39
-
40
-
41
- def display_registered_svcs(service: str, server: str, url: str,
42
- username: str, password: str, jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH
43
- ):
44
- """ Display the registered services list
28
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
29
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
30
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
31
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
32
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
33
+ )
34
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
35
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
36
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
37
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
38
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
39
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
40
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
41
+
42
+
43
+ def display_registered_svcs(
44
+ service: str,
45
+ server: str,
46
+ url: str,
47
+ username: str,
48
+ password: str,
49
+ jupyter: bool = EGERIA_JUPYTER,
50
+ width: int = EGERIA_WIDTH,
51
+ ):
52
+ """Display the registered services list
45
53
  Parameters
46
54
  ----------
47
55
  service : str, optional
@@ -72,14 +80,14 @@ def display_registered_svcs(service: str, server: str, url: str,
72
80
  show_lines=True,
73
81
  box=box.ROUNDED,
74
82
  caption=f"Registered Services from Server '{server}' @ Platform - {url}",
75
- expand=True
83
+ expand=True,
76
84
  )
77
85
  table.add_column("Service Id")
78
86
  table.add_column("Service Name")
79
87
  table.add_column("Service Development Status")
80
88
  table.add_column("URL Marker")
81
89
  table.add_column("Description")
82
- table.add_column("Wiki",no_wrap=True)
90
+ table.add_column("Wiki", no_wrap=True)
83
91
  table.add_column("Server Type")
84
92
  table.add_column("Partner Service Name")
85
93
  table.add_column("Partner Service Type")
@@ -96,8 +104,14 @@ def display_registered_svcs(service: str, server: str, url: str,
96
104
  svc_partner_svc_type = svc.get("partnerServiceType", " ")
97
105
 
98
106
  table.add_row(
99
- svc_id, svc_name, svc_dev_status, svc_url_marker, svc_description, svc_wiki,
100
- svc_partner_svc_name, svc_partner_svc_type
107
+ svc_id,
108
+ svc_name,
109
+ svc_dev_status,
110
+ svc_url_marker,
111
+ svc_description,
112
+ svc_wiki,
113
+ svc_partner_svc_name,
114
+ svc_partner_svc_type,
101
115
  )
102
116
  return table
103
117
  elif type(svc_list) is str:
@@ -129,7 +143,11 @@ def display_registered_svcs(service: str, server: str, url: str,
129
143
  with console.pager(styles=True):
130
144
  console.print(generate_table(svc_list))
131
145
 
132
- except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
146
+ except (
147
+ InvalidParameterException,
148
+ PropertyServerException,
149
+ UserNotAuthorizedException,
150
+ ) as e:
133
151
  console.print_exception(show_locals=True)
134
152
  finally:
135
153
  a_client.close_session()
@@ -150,9 +168,11 @@ def main():
150
168
  password = args.password if args.password is not None else EGERIA_USER_PASSWORD
151
169
 
152
170
  try:
153
- svc_kind = Prompt.ask("Enter the service type you are searching for:", default="all")
171
+ svc_kind = Prompt.ask(
172
+ "Enter the service type you are searching for:", default="all"
173
+ )
154
174
  display_registered_svcs(svc_kind, server, url, userid, password=password)
155
- except(KeyboardInterrupt):
175
+ except KeyboardInterrupt:
156
176
  pass
157
177
 
158
178
 
@@ -18,29 +18,45 @@ from rich.markdown import Markdown
18
18
  from rich.prompt import Prompt
19
19
  from rich.table import Table
20
20
 
21
- from pyegeria import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
22
- print_exception_response, ClassificationManager)
21
+ from pyegeria import (
22
+ InvalidParameterException,
23
+ PropertyServerException,
24
+ UserNotAuthorizedException,
25
+ print_exception_response,
26
+ ClassificationManager,
27
+ )
23
28
 
24
29
  console = Console()
25
30
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
26
- EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
27
- EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
28
- EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
29
- EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
30
- EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
31
- EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
32
- EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
33
- EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
34
- EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
35
- EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
36
- EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
37
-
38
-
39
- def display_related_specification(element_guid: str, server: str, url: str, username: str, password: str,
40
- jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
31
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
32
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
33
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
34
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
35
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
36
+ )
37
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
38
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
39
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
40
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
41
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
42
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
43
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
44
+
45
+
46
+ def display_related_specification(
47
+ element_guid: str,
48
+ server: str,
49
+ url: str,
50
+ username: str,
51
+ password: str,
52
+ jupyter: bool = EGERIA_JUPYTER,
53
+ width: int = EGERIA_WIDTH,
54
+ ):
41
55
  c_client = ClassificationManager(server, url, user_id=username, user_pwd=password)
42
56
  token = c_client.create_egeria_bearer_token()
43
- rel_el = c_client.get_related_elements(element_guid, 'SpecificationPropertyAssignment', None)
57
+ rel_el = c_client.get_related_elements(
58
+ element_guid, "SpecificationPropertyAssignment", None
59
+ )
44
60
 
45
61
  if type(rel_el) is str:
46
62
  print(f"\n\nDid not find related specifications for {element_guid}\n\n")
@@ -50,54 +66,59 @@ def display_related_specification(element_guid: str, server: str, url: str, user
50
66
 
51
67
  def generate_table() -> Table:
52
68
  """Make a new table."""
53
- table = Table(title=f"Specifications related to: {element_guid} @ {time.asctime()}",
54
- style="bold bright_white on black", row_styles=["bold bright_white on black"],
55
- header_style="white on dark_blue", title_style="bold bright_white on black", caption_style="white on black",
56
- show_lines=True, box=box.ROUNDED, caption=f"Elements from Server '{server}' @ Platform - {url}",
57
- expand=True, # width=500
69
+ table = Table(
70
+ title=f"Specifications related to: {element_guid} @ {time.asctime()}",
71
+ style="bold bright_white on black",
72
+ row_styles=["bold bright_white on black"],
73
+ header_style="white on dark_blue",
74
+ title_style="bold bright_white on black",
75
+ caption_style="white on black",
76
+ show_lines=True,
77
+ box=box.ROUNDED,
78
+ caption=f"Elements from Server '{server}' @ Platform - {url}",
79
+ expand=True, # width=500
58
80
  )
59
81
 
60
- table.add_column("Name", justify='center', style="bold bright_white")
61
- table.add_column("Specification", justify='center', style="bold bright_white")
82
+ table.add_column("Name", justify="center", style="bold bright_white")
83
+ table.add_column("Specification", justify="center", style="bold bright_white")
62
84
 
63
85
  for element in rel_el:
64
- relationship_props = element["relationshipProperties"]['propertyType']
86
+ relationship_props = element["relationshipProperties"]["propertyType"]
65
87
  related_elements[relationship_props] = []
66
88
 
67
89
  for element in rel_el:
68
- relationship_props = element["relationshipProperties"]['propertyType']
90
+ relationship_props = element["relationshipProperties"]["propertyType"]
69
91
 
70
- rel_element = element['relatedElement']
92
+ rel_element = element["relatedElement"]
71
93
  el = rel_element["properties"]
72
94
  re: dict = {}
73
95
 
74
- re['case'] = el.get("isCaseSensitive", '---')
75
- re['name'] = el.get("preferredValue", '---')
76
- re['description'] = el.get("description", '---')
77
- add = el.get("additionalProperties", '---')
96
+ re["case"] = el.get("isCaseSensitive", "---")
97
+ re["name"] = el.get("preferredValue", "---")
98
+ re["description"] = el.get("description", "---")
99
+ add = el.get("additionalProperties", "---")
78
100
  if type(add) is str:
79
- re['additional'] = add
101
+ re["additional"] = add
80
102
  else:
81
103
  add_md = ""
82
104
  for k in add.keys():
83
105
  add_md += f"* {k}: {add[k]}\n"
84
- re['additional'] = Markdown(add_md)
106
+ re["additional"] = Markdown(add_md)
85
107
 
86
108
  related_elements[relationship_props].append(re)
87
109
 
88
110
  for kind in related_elements.keys():
89
-
90
111
  spec_table = Table(expand=False, show_lines=True)
91
- spec_table.add_column('Name')
92
- spec_table.add_column('Case Sensitive?')
93
- spec_table.add_column('Description')
94
- spec_table.add_column('Additional Properties')
112
+ spec_table.add_column("Name")
113
+ spec_table.add_column("Case Sensitive?")
114
+ spec_table.add_column("Description")
115
+ spec_table.add_column("Additional Properties")
95
116
 
96
117
  for spec_row in related_elements[kind]:
97
- name = spec_row['name']
98
- case = spec_row['case']
99
- desc = spec_row['description']
100
- additional_props = spec_row['additional']
118
+ name = spec_row["name"]
119
+ case = spec_row["case"]
120
+ desc = spec_row["description"]
121
+ additional_props = spec_row["additional"]
101
122
  spec_table.add_row(name, case, desc, additional_props)
102
123
 
103
124
  table.add_row(kind, spec_table)
@@ -110,7 +131,11 @@ def display_related_specification(element_guid: str, server: str, url: str, user
110
131
  with console.pager(styles=True):
111
132
  console.print(generate_table())
112
133
 
113
- except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
134
+ except (
135
+ InvalidParameterException,
136
+ PropertyServerException,
137
+ UserNotAuthorizedException,
138
+ ) as e:
114
139
  print_exception_response(e)
115
140
  assert e.related_http_code != "200", "Invalid parameters"
116
141
  finally:
@@ -136,7 +161,7 @@ def main():
136
161
  element_guid = Prompt.ask("Enter an Element GUID find relationships for")
137
162
 
138
163
  display_related_specification(element_guid, server, url, userid, password)
139
- except(KeyboardInterrupt):
164
+ except KeyboardInterrupt:
140
165
  pass
141
166
 
142
167
 
@@ -26,23 +26,31 @@ from pyegeria import (
26
26
  from pyegeria import ValidMetadataManager
27
27
 
28
28
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
29
- EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
30
- EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
31
- EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
32
- EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
33
- EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
34
- EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
35
- EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
36
- EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
37
- EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
38
- EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
39
- EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
40
-
41
-
42
- def display_relationship_types(type_name: str, server: str, url: str,
43
- username: str, user_pass: str, save_output: bool = False, jupyter: bool = EGERIA_JUPYTER,
44
- width: int = EGERIA_WIDTH
45
- ):
29
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
30
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
31
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
32
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
33
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
34
+ )
35
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
36
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
37
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
38
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
39
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
40
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
41
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
42
+
43
+
44
+ def display_relationship_types(
45
+ type_name: str,
46
+ server: str,
47
+ url: str,
48
+ username: str,
49
+ user_pass: str,
50
+ save_output: bool = False,
51
+ jupyter: bool = EGERIA_JUPYTER,
52
+ width: int = EGERIA_WIDTH,
53
+ ):
46
54
  p_client = ValidMetadataManager(server, url, user_id=username)
47
55
  token = p_client.create_egeria_bearer_token(username, user_pass)
48
56
 
@@ -58,7 +66,7 @@ def display_relationship_types(type_name: str, server: str, url: str,
58
66
  show_lines=True,
59
67
  box=box.ROUNDED,
60
68
  caption=f"list for Server '{server}' @ Platform - {url}",
61
- expand=True
69
+ expand=True,
62
70
  )
63
71
 
64
72
  table.add_column("Status")
@@ -85,38 +93,49 @@ def display_relationship_types(type_name: str, server: str, url: str,
85
93
  raise ValueError("-->This is not a known Type")
86
94
  else:
87
95
  for types in types_list:
88
-
89
- name = types['name']
96
+ name = types["name"]
90
97
  # guid = types['guid']
91
- status = types['initialStatus']
92
- description = types['description']
98
+ status = types["initialStatus"]
99
+ description = types["description"]
93
100
  description_wiki = types.get("descriptionWiki", " ")
94
101
  attribute_defs = types.get("attributeDefinitions")
95
102
  if attribute_defs:
96
103
  for attr in attribute_defs:
97
- attr_name = attr['attributeName']
98
- attr_desc = attr['attributeDescription']
99
- attr_status = attr['attributeStatus']
100
- attr_type = attr['attributeType']["name"]
104
+ attr_name = attr["attributeName"]
105
+ attr_desc = attr["attributeDescription"]
106
+ attr_status = attr["attributeStatus"]
107
+ attr_type = attr["attributeType"]["name"]
101
108
  table.add_row(
102
- status, name, description, attr_name, attr_status, attr_type, attr_desc,
103
- description_wiki
109
+ status,
110
+ name,
111
+ description,
112
+ attr_name,
113
+ attr_status,
114
+ attr_type,
115
+ attr_desc,
116
+ description_wiki,
104
117
  )
105
118
  else:
106
- table.add_row(status, name, description, description_wiki, " ", " ", " ", " ")
119
+ table.add_row(
120
+ status, name, description, description_wiki, " ", " ", " ", " "
121
+ )
107
122
 
108
123
  p_client.close_session()
109
124
  return table
110
125
 
111
126
  try:
112
-
113
127
  console = Console(width=width, force_terminal=not jupyter, record=True)
114
128
  with console.pager(styles=True):
115
129
  console.print(generate_table(type_name))
116
130
  if save_output:
117
131
  console.save_html("projects.html")
118
132
 
119
- except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ValueError) as e:
133
+ except (
134
+ InvalidParameterException,
135
+ PropertyServerException,
136
+ UserNotAuthorizedException,
137
+ ValueError,
138
+ ) as e:
120
139
  if type(e) is str:
121
140
  print(e)
122
141
  else: