pyegeria 0.5.8.16__py3-none-any.whl → 0.5.8.17__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.
@@ -21,6 +21,7 @@ from pyegeria import (
21
21
  UserNotAuthorizedException,
22
22
  AssetCatalog
23
23
  )
24
+
24
25
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
25
26
  EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
26
27
  EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
@@ -32,16 +33,18 @@ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
32
33
  EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
33
34
  EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
34
35
  EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
36
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
37
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
35
38
 
36
39
  disable_ssl_warnings = True
37
40
 
38
- console = Console(width=200)
39
-
41
+ console = Console(width=EGERIA_WIDTH, force_terminal=(not EGERIA_JUPYTER))
40
42
 
41
43
  guid_list = []
42
44
 
43
- def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, user_pass:str):
44
45
 
46
+ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str, user_pass: str,
47
+ jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
45
48
  def build_classifications(classification: dict) -> Markdown:
46
49
 
47
50
  class_md = ""
@@ -50,7 +53,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
50
53
  if c_type == "Anchors":
51
54
  continue
52
55
  class_md += f"\n* Classification: {c_type}\n"
53
- class_props = c.get("classificationProperties","---")
56
+ class_props = c.get("classificationProperties", "---")
54
57
  if type(class_props) is dict:
55
58
  for prop in class_props.keys():
56
59
  class_md += f"\t* {prop}: {class_props[prop]}\n"
@@ -72,7 +75,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
72
75
  ne_classifications = nested_element["classifications"]
73
76
  ne_class_md = build_classifications(ne_classifications)
74
77
  # ne_class_md = " " if ne_class_md is None else ne_class_md
75
- ne_props = nested_element.get("properties","---")
78
+ ne_props = nested_element.get("properties", "---")
76
79
  ne_prop_md = "\n"
77
80
  if type(ne_props) is dict:
78
81
  for prop in ne_props.keys():
@@ -90,7 +93,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
90
93
  try:
91
94
 
92
95
  a_client = AssetCatalog(server_name, platform_url,
93
- user_id=user)
96
+ user_id=user)
94
97
 
95
98
  token = a_client.create_egeria_bearer_token(user, user_pass)
96
99
  # asset_info = a_client.find_assets_in_domain(asset_name)
@@ -109,7 +112,6 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
109
112
 
110
113
  # print(f"\n{json.dumps(asset_graph, indent =2)}\n")
111
114
 
112
-
113
115
  asset_name = asset_graph["displayName"]
114
116
  qualified_name = asset_graph["qualifiedName"]
115
117
  resource_name = asset_graph["resourceName"]
@@ -118,18 +120,17 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
118
120
  style = ""
119
121
 
120
122
  asset_type = asset_graph["type"]["typeName"]
121
- asset_deployed_imp_type = asset_graph.get("deployedImplementationType","---")
123
+ asset_deployed_imp_type = asset_graph.get("deployedImplementationType", "---")
122
124
 
123
125
  asset_origin = asset_graph["origin"]["homeMetadataCollectionName"]
124
126
  asset_creation = asset_graph["versions"]["createTime"]
125
127
  asset_created_by = asset_graph["versions"]["createdBy"]
126
128
  asset_classifications = asset_graph["classifications"]
127
- asset_nested_elements = asset_graph.get("anchoredElements","----")
129
+ asset_nested_elements = asset_graph.get("anchoredElements", "----")
128
130
  asset_relationships = asset_graph["relationships"]
129
131
  asset_class_md = build_classifications(asset_classifications)
130
132
 
131
-
132
- asset_properties = asset_graph.get("extendedProperties",None)
133
+ asset_properties = asset_graph.get("extendedProperties", None)
133
134
  if asset_properties is not None:
134
135
  prop_md = "\n* Extended Properties:\n"
135
136
  for prop in asset_properties:
@@ -137,28 +138,28 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
137
138
  else:
138
139
  prop_md = ""
139
140
  core_md = (f"**Type: {asset_type} Created by: {asset_created_by} on {asset_creation}**\n"
140
- f"* Deployed Implementation Type: {asset_deployed_imp_type}\n"
141
- f"* Qualified Name: {qualified_name}\n "
142
- f"* Resource Name: {resource_name}\n"
143
- f"* Display Name: {asset_name}\n"
144
- f"* Asset Origin: {asset_origin}\n{prop_md}\n"
145
- )
141
+ f"* Deployed Implementation Type: {asset_deployed_imp_type}\n"
142
+ f"* Qualified Name: {qualified_name}\n "
143
+ f"* Resource Name: {resource_name}\n"
144
+ f"* Display Name: {asset_name}\n"
145
+ f"* Asset Origin: {asset_origin}\n{prop_md}\n"
146
+ )
146
147
  core_md = Markdown(core_md)
147
148
 
148
- p1 = Panel.fit(core_md, style = "bold bright_white")
149
+ p1 = Panel.fit(core_md, style="bold bright_white")
149
150
  l2 = tree.add(p1)
150
151
  if asset_class_md is not None:
151
- p2 = Panel.fit(Markdown(asset_class_md), style = "bold bright_white", title = "Classifications")
152
+ p2 = Panel.fit(Markdown(asset_class_md), style="bold bright_white", title="Classifications")
152
153
  l2 = tree.add(p2)
153
154
 
154
155
  #
155
156
  # Nested Assets
156
157
  #
157
158
  if type(asset_nested_elements) is list:
158
- l2 = tree.add("Nested Elements", style = "bold white")
159
+ l2 = tree.add("Nested Elements", style="bold white")
159
160
  for el in asset_nested_elements:
160
161
  asset_ne_md = build_nested_elements(el)
161
- p3 = Panel.fit(asset_ne_md, style = "bold bright_white", title="Nested Elements")
162
+ p3 = Panel.fit(asset_ne_md, style="bold bright_white", title="Nested Elements")
162
163
  l2.add(p3)
163
164
 
164
165
  #
@@ -169,7 +170,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
169
170
  rel_end1 = relationship["end1"]
170
171
  rel_end1_type = rel_end1["type"]["typeName"]
171
172
  rel_end1_guid = rel_end1["guid"]
172
- rel_end1_unique_name = rel_end1.get("uniqueName","---")
173
+ rel_end1_unique_name = rel_end1.get("uniqueName", "---")
173
174
 
174
175
  rel_end2 = relationship["end2"]
175
176
  rel_end2_type = rel_end2["type"]["typeName"]
@@ -184,13 +185,12 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
184
185
  relationship_type = relationship["type"]["typeName"]
185
186
  relationship_created_by = relationship["versions"]["createdBy"]
186
187
  relationship_creation_time = relationship["versions"]["createTime"]
187
- relationship_properties = relationship.get("properties","--- ")
188
+ relationship_properties = relationship.get("properties", "--- ")
188
189
  relationship_md = (f"Relationship Type {relationship_type}\n"
189
190
  f"* GUID: {relationship_guid}\n* Created by: {relationship_created_by} \n"
190
191
  f"* Creation Time: {relationship_creation_time}\n"
191
192
  f"* Properties: {relationship_properties}\n")
192
193
 
193
-
194
194
  rel_md = (
195
195
  f"* Relationship Type: {relationship_type}\n"
196
196
  f"* Relationship GUID: {relationship_guid}\n"
@@ -201,7 +201,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
201
201
  f"\t* Type: {rel_end1_type}\n"
202
202
  f"\t* GUID: {rel_end1_guid}\n"
203
203
  f"\t* Unique Name: {rel_end1_unique_name}\n"
204
- )
204
+ )
205
205
 
206
206
  # if rel_end1_class_md is not None:
207
207
  # rel_end1_md = rel_end1_class_md + rel_end1_md
@@ -221,7 +221,8 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
221
221
 
222
222
  relationship_md += rel_end1_md + rel_end2_md
223
223
 
224
- relationship_panel = Panel.fit(Markdown(relationship_md), style="bold bright_white", title = "Asset Relationships")
224
+ relationship_panel = Panel.fit(Markdown(relationship_md), style="bold bright_white",
225
+ title="Asset Relationships")
225
226
  tree.add(relationship_panel)
226
227
 
227
228
  with console.screen():
@@ -229,13 +230,14 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str, u
229
230
  print(tree)
230
231
 
231
232
  except (
232
- InvalidParameterException,
233
- PropertyServerException,
234
- UserNotAuthorizedException
233
+ InvalidParameterException,
234
+ PropertyServerException,
235
+ UserNotAuthorizedException
235
236
  ) as e:
236
237
  console.print_exception()
237
238
  console.print("\n\n ======> Most likely the GUID you provided is either incorrect or not an asset\n[red bold]")
238
239
 
240
+
239
241
  def main():
240
242
  parser = argparse.ArgumentParser()
241
243
 
@@ -251,10 +253,11 @@ def main():
251
253
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
252
254
  try:
253
255
  asset_guid = Prompt.ask("Enter the Asset GUID to view:", default="")
254
- asset_viewer(asset_guid,server, url, userid, user_pass)
256
+ asset_viewer(asset_guid, server, url, userid, user_pass)
255
257
  except (KeyboardInterrupt) as e:
256
258
  # console.print_exception()
257
259
  pass
258
260
 
261
+
259
262
  if __name__ == "__main__":
260
- main()
263
+ main()
@@ -144,7 +144,7 @@ def gov_eng_status(ctx, list):
144
144
  """Display engine-host status information"""
145
145
  c = ctx.obj
146
146
  display_gov_eng_status(c.engine_host, c.engine_host_url,
147
- c.userid, c.password,
147
+ c.admin_user, c.admin_user_password,
148
148
  list, c.jupyter, c.width)
149
149
 
150
150
 
@@ -155,7 +155,7 @@ def eng_activity_status(ctx, list):
155
155
  """Show Governance Activity in engine-host"""
156
156
  c = ctx.obj
157
157
  display_engine_activity(c.view_server, c.view_server_url,
158
- c.userid, c.password,
158
+ c.admin_user, c.admin_user_password,
159
159
  list, c.jupyter, c.width)
160
160
 
161
161
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.5.8.16
3
+ Version: 0.5.8.17
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -2,14 +2,14 @@ examples/doc_samples/Create_Collection_Sample.py,sha256=D8nhc4qLXIzAqVdJQjmFIS-j
2
2
  examples/doc_samples/Create_Sustainability_Collection_Sample.py,sha256=iLBm1LwRLi42Gayyb-wcWZ5NySQ6sc4kVSmwIAzP2Po,5049
3
3
  examples/widgets/catalog_user/README.md,sha256=aCCVo7iqyE-XGEvmoYXnkIGM0VskF95JTj6Egzec7LM,883
4
4
  examples/widgets/catalog_user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- examples/widgets/catalog_user/get_asset_graph.py,sha256=YgdB9bgWBEGAADS54vMGVKG6SVJuIDI_vegsWFFtzYE,10642
5
+ examples/widgets/catalog_user/get_asset_graph.py,sha256=y9CXPSd2Ao0o0xIFzzvBdTCxhdvwNU5-C_w1DkFv0pQ,10961
6
6
  examples/widgets/catalog_user/get_collection.py,sha256=YexVIXm0fsG9ODYCrdjiH5j8s0jDg1SBXTLpohoEE-A,4414
7
7
  examples/widgets/catalog_user/get_tech_type_elements.py,sha256=h7tEr0KGio9R6XL_GLxOxAGEOqpXY5qbgnPas7pF8Uw,5908
8
8
  examples/widgets/catalog_user/get_tech_type_template.py,sha256=2bGRMIcXqlMFwNGRdobK-QtHW2TLM2kq0gxKgS_XzaM,5928
9
9
  examples/widgets/catalog_user/list_assets.py,sha256=MRWha0yS3JPQEZNXqAktbEWYiU3kxdcmu4mV7YravQQ,5668
10
10
  examples/widgets/catalog_user/list_glossary.py,sha256=abw3iBFEPHcSpucq2Jqh6UEOILyzx2IfBWS9gPl968k,5176
11
11
  examples/widgets/cli/__init__.py,sha256=ReG7mIcm5c512S_z1UZIpMtE67zlO_zj-1HhHWYS4fI,30
12
- examples/widgets/cli/egeria_ops.py,sha256=DAXqBV3aK5mKNIMAzFfKBMu5VxM8-5qjTe3DFkPPrxw,9604
12
+ examples/widgets/cli/egeria_ops.py,sha256=Zsexe-dMY8wS_UHASmqmRg507wL947cQThkYz8BZkc8,9634
13
13
  examples/widgets/cli/ops_config.py,sha256=BPfiU2mZA61aA1p1DHRA5eLWH8qaAwgWNoRmazzAlM4,1398
14
14
  examples/widgets/developer/README.md,sha256=nxDnfr3BCiGgW5G1VxWxiwUWJXIe5wreNuUeRyIt_hY,1343
15
15
  examples/widgets/developer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -69,8 +69,8 @@ pyegeria/runtime_manager_omvs.py,sha256=WekK7Yeyn6Qu9YmbSDo3m57MN0xOsIm9M8kGHfRO
69
69
  pyegeria/server_operations.py,sha256=ZX7FlJRrAC7RK4bq4wHWepEsYbbWlqkUZdsJrTplVVU,16534
70
70
  pyegeria/utils.py,sha256=pkVmS3RrbjaS9yz7FtOCwaOfV5FMqz-__Rt5koCnd9c,5374
71
71
  pyegeria/valid_metadata_omvs.py,sha256=aisdRodIwJSkyArAzfm_sEnBELh69xE8k4Nea-vHu8M,36745
72
- pyegeria-0.5.8.16.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
73
- pyegeria-0.5.8.16.dist-info/METADATA,sha256=B0L1BnjFI3pE0P6h5ldv6xm_tL8EZeUTGUjOwIZoPaI,2689
74
- pyegeria-0.5.8.16.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
75
- pyegeria-0.5.8.16.dist-info/entry_points.txt,sha256=5aexqWL8P1vQZrEK4bQLfelOnFfZtXFmWYS0pLa4NmE,2772
76
- pyegeria-0.5.8.16.dist-info/RECORD,,
72
+ pyegeria-0.5.8.17.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
73
+ pyegeria-0.5.8.17.dist-info/METADATA,sha256=617RZLxsk5teuWCBkduQiNeg-Qjvsg1_3so9YW_W2hY,2689
74
+ pyegeria-0.5.8.17.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
75
+ pyegeria-0.5.8.17.dist-info/entry_points.txt,sha256=j0d5yv7-sYUFiN93E83CQsi7Yi-EHIIiNh7q3-Zmphs,2766
76
+ pyegeria-0.5.8.17.dist-info/RECORD,,
@@ -5,12 +5,12 @@ get_asset_graph=examples.widgets.catalog_user.get_asset_graph:main
5
5
  get_collection=examples.widgets.catalog_user.get_collection:main
6
6
  get_guid_info=examples.widgets.developer.get_guid_info:main
7
7
  get_tech_details=examples.widgets.developer.get_tech_details:main
8
- get_tech_type_elements=examples.widgets.operational.get_tech_type_elements:main
9
- get_tech_type_template=examples.widgets.operational.get_tech_type_template:main
8
+ get_tech_type_elements=examples.widgets.catalog_user.get_tech_type_elements:main
9
+ get_tech_type_template=examples.widgets.catalog_user.get_tech_type_template:main
10
10
  list_asset_types=examples.widgets.developer.list_asset_types:main
11
11
  list_assets=examples.widgets.catalog_user.list_assets:main
12
12
  list_catalog_targets=examples.widgets.operational.list_catalog_targets:main
13
- list_eng_action_status=examples.widgets.operational.monitor_eng_action_status:main_paging
13
+ list_engine_activity=examples.widgets.operational.monitor_engine_activity:main_paging
14
14
  list_glossary=examples.widgets.catalog_user.list_glossary:main
15
15
  list_gov_eng_status=examples.widgets.operational.monitor_gov_eng_status:main_paging
16
16
  list_integ_daemon_status=examples.widgets.operational.monitor_integ_daemon_status:main_paging
@@ -26,7 +26,7 @@ load_archive=examples.widgets.operational.load_archive:load_archive
26
26
  load_archive_tui=examples.widgets.operational.load_archive:tui
27
27
  monitor_asset_events=examples.widgets.operational.monitor_asset_events:main
28
28
  monitor_coco_status=examples.widgets.operational.monitor_coco_status:main
29
- monitor_eng_action_status=examples.widgets.operational.monitor_eng_action_status:main_live
29
+ monitor_engine_activity=examples.widgets.operational.monitor_engine_activity:main_live
30
30
  monitor_gov_eng_status=examples.widgets.operational.monitor_gov_eng_status:main_live
31
31
  monitor_integ_daemon_status=examples.widgets.operational.monitor_integ_daemon_status:main_live
32
32
  monitor_my_todos=examples.widgets.personal_organizer.monitor_my_todos:main