pyegeria 0.8.4.38__py3-none-any.whl → 0.8.4.39__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.
@@ -20,22 +20,26 @@ from pyegeria import (
20
20
  InvalidParameterException,
21
21
  PropertyServerException,
22
22
  UserNotAuthorizedException,
23
- AssetCatalog
23
+ AssetCatalog,
24
24
  )
25
25
 
26
26
  EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
27
- EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
28
- EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
29
- EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
30
- EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
31
- EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
32
- EGERIA_INTEGRATION_DAEMON_URL = os.environ.get('EGERIA_INTEGRATION_DAEMON_URL', 'https://localhost:9443')
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'))
27
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
28
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
29
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
30
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
31
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
32
+ )
33
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
34
+ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
35
+ "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
36
+ )
37
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
38
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
39
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
40
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
41
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
42
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
39
43
 
40
44
  disable_ssl_warnings = True
41
45
 
@@ -43,10 +47,17 @@ guid_list = []
43
47
 
44
48
  console = Console(width=EGERIA_WIDTH, force_terminal=(not EGERIA_JUPYTER))
45
49
 
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):
48
- def build_classifications(classification: dict) -> Markdown:
49
50
 
51
+ def asset_viewer(
52
+ asset_guid: str,
53
+ server_name: str,
54
+ platform_url: str,
55
+ user: str,
56
+ user_pass: str,
57
+ jupyter: bool = EGERIA_JUPYTER,
58
+ width: int = EGERIA_WIDTH,
59
+ ):
60
+ def build_classifications(classification: dict) -> Markdown:
50
61
  class_md = ""
51
62
  for c in classification:
52
63
  c_type = c["classificationName"]
@@ -65,7 +76,7 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
65
76
 
66
77
  def build_nested_elements(nested_element: dict) -> Markdown:
67
78
  ne_md = " "
68
- ne_header = nested_element['elementHeader']
79
+ ne_header = nested_element["elementHeader"]
69
80
  ne_created_by = ne_header["versions"]["createdBy"]
70
81
  ne_created_at = ne_header["versions"]["createTime"]
71
82
  ne_guid = ne_header["guid"]
@@ -80,9 +91,11 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
80
91
  if type(ne_props) is dict:
81
92
  for prop in ne_props.keys():
82
93
  ne_prop_md += f"\t* {prop}: {ne_props[prop]}\n"
83
- ne_md = (f"Nested Element of Type: {ne_type} with GUID: {ne_guid} \n "
84
- f"* created by {ne_created_by} at time {ne_created_at}\n"
85
- f"\n* Properties:\n{ne_prop_md}\n")
94
+ ne_md = (
95
+ f"Nested Element of Type: {ne_type} with GUID: {ne_guid} \n "
96
+ f"* created by {ne_created_by} at time {ne_created_at}\n"
97
+ f"\n* Properties:\n{ne_prop_md}\n"
98
+ )
86
99
 
87
100
  if ne_class_md is not None:
88
101
  ne_md += f"* {ne_class_md}"
@@ -91,8 +104,7 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
91
104
  return output
92
105
 
93
106
  try:
94
- a_client = AssetCatalog(server_name, platform_url,
95
- user_id=user)
107
+ a_client = AssetCatalog(server_name, platform_url, user_id=user)
96
108
 
97
109
  token = a_client.create_egeria_bearer_token(user, user_pass)
98
110
  # asset_info = a_client.find_assets_in_domain(asset_name)
@@ -111,15 +123,28 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
111
123
 
112
124
  # print(f"\n{json.dumps(asset_graph, indent =2)}\n")
113
125
 
114
- asset_name = asset_graph["properties"].get("displayName",'---')
115
- qualified_name = asset_graph["properties"]["qualifiedName"]
116
- resource_name = asset_graph['properties'].get("resourceName","---")
117
-
118
- tree = Tree(f"{asset_name} ({asset_guid})", style="bold bright_white on black", guide_style="bold bright_blue")
126
+ asset_display_name = asset_graph["properties"].get("displayName", "---")
127
+ asset_display_description = asset_graph["properties"].get(
128
+ "displayDescription", "---"
129
+ )
130
+ asset_name = asset_graph["properties"].get("name", "---")
131
+ asset_resource_name = asset_graph["properties"].get("resourceName", "---")
132
+ asset_resource_description = asset_graph["properties"].get(
133
+ "resourceDescription", "---"
134
+ )
135
+ qualified_name = asset_graph["properties"].get("qualifiedName", "---")
136
+
137
+ tree = Tree(
138
+ f"{asset_name} ({asset_guid})",
139
+ style="bold bright_white on black",
140
+ guide_style="bold bright_blue",
141
+ )
119
142
  style = ""
120
- asset_elements = asset_graph['elementHeader']
143
+ asset_elements = asset_graph["elementHeader"]
121
144
  asset_type = asset_elements["type"]["typeName"]
122
- asset_deployed_imp_type = asset_graph.get("deployedImplementationType", "---")
145
+ asset_deployed_imp_type = asset_graph["properties"].get(
146
+ "deployedImplementationType", "---"
147
+ )
123
148
 
124
149
  asset_origin = asset_elements["origin"]["homeMetadataCollectionName"]
125
150
  asset_creation = asset_elements["versions"]["createTime"]
@@ -129,26 +154,48 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
129
154
  asset_relationships = asset_graph["relationships"]
130
155
  asset_class_md = build_classifications(asset_classifications)
131
156
 
132
- asset_properties = asset_graph.get("extendedProperties", None)
133
- if asset_properties is not None:
157
+ additional_properties = asset_graph["properties"].get(
158
+ "additionalProperties", None
159
+ )
160
+ if additional_properties is not None:
161
+ add_prop_md = "\n* Additional Properties:\n"
162
+ for prop in additional_properties:
163
+ add_prop_md = (
164
+ f"{add_prop_md}\n\t* {prop}: {additional_properties[prop]}\n"
165
+ )
166
+ else:
167
+ add_prop_md = ""
168
+
169
+ extended_properties = asset_graph["properties"].get("extendedProperties", None)
170
+ if extended_properties is not None:
134
171
  prop_md = "\n* Extended Properties:\n"
135
- for prop in asset_properties:
136
- prop_md = f"{prop_md}\n\t* {prop}: {asset_properties[prop]}\n"
172
+ for prop in extended_properties:
173
+ prop_md = f"{prop_md}\n\t* {prop}: {extended_properties[prop]}\n"
137
174
  else:
138
175
  prop_md = ""
139
- 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
- )
176
+ core_md = (
177
+ f"**Type: {asset_type} Created by: {asset_created_by} on {asset_creation}**\n"
178
+ f"* Deployed Implementation Type: {asset_deployed_imp_type}\n"
179
+ f"* Name: {asset_name}\n "
180
+ f"* Asset Resource Name: {asset_resource_name}\n"
181
+ f"* Asset Resource Description: {asset_resource_description}\n "
182
+ f"* Asset Display Name: {asset_display_name}\n"
183
+ f"* Asset Display Description: {asset_display_description}\n "
184
+ f"* Qualified Name: {qualified_name}\n "
185
+ f"* Asset Origin: {asset_origin}\n"
186
+ f" {prop_md}\n"
187
+ f" {add_prop_md}\n"
188
+ )
146
189
  core_md = Markdown(core_md)
147
190
 
148
191
  p1 = Panel.fit(core_md, style="bold bright_white")
149
192
  l2 = tree.add(p1)
150
193
  if asset_class_md is not None:
151
- p2 = Panel.fit(Markdown(asset_class_md), style="bold bright_white", title="Classifications")
194
+ p2 = Panel.fit(
195
+ Markdown(asset_class_md),
196
+ style="bold bright_white",
197
+ title="Classifications",
198
+ )
152
199
  l2 = tree.add(p2)
153
200
 
154
201
  #
@@ -158,7 +205,9 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
158
205
  l2 = tree.add("Nested Elements", style="bold white")
159
206
  for el in asset_nested_elements:
160
207
  asset_ne_md = build_nested_elements(el)
161
- p3 = Panel.fit(asset_ne_md, style="bold bright_white", title="Nested Elements")
208
+ p3 = Panel.fit(
209
+ asset_ne_md, style="bold bright_white", title="Nested Elements"
210
+ )
162
211
  l2.add(p3)
163
212
 
164
213
  #
@@ -185,10 +234,12 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
185
234
  relationship_created_by = relationship["versions"]["createdBy"]
186
235
  relationship_creation_time = relationship["versions"]["createTime"]
187
236
  relationship_properties = relationship.get("properties", "--- ")
188
- relationship_md = (f"Relationship Type {relationship_type}\n"
189
- f"* GUID: {relationship_guid}\n* Created by: {relationship_created_by} \n"
190
- f"* Creation Time: {relationship_creation_time}\n"
191
- f"* Properties: {relationship_properties}\n")
237
+ relationship_md = (
238
+ f"Relationship Type {relationship_type}\n"
239
+ f"* GUID: {relationship_guid}\n* Created by: {relationship_created_by} \n"
240
+ f"* Creation Time: {relationship_creation_time}\n"
241
+ f"* Properties: {relationship_properties}\n"
242
+ )
192
243
 
193
244
  rel_md = (
194
245
  f"* Relationship Type: {relationship_type}\n"
@@ -220,20 +271,25 @@ def asset_viewer(asset_guid: str, server_name: str, platform_url: str, user: str
220
271
 
221
272
  relationship_md += rel_end1_md + rel_end2_md
222
273
 
223
- relationship_panel = Panel.fit(Markdown(relationship_md), style="bold bright_white",
224
- title="Asset Relationships")
274
+ relationship_panel = Panel.fit(
275
+ Markdown(relationship_md),
276
+ style="bold bright_white",
277
+ title="Asset Relationships",
278
+ )
225
279
  tree.add(relationship_panel)
226
280
  with console.screen():
227
281
  print("\n\n")
228
282
  print(tree)
229
283
 
230
284
  except (
231
- InvalidParameterException,
232
- PropertyServerException,
233
- UserNotAuthorizedException
285
+ InvalidParameterException,
286
+ PropertyServerException,
287
+ UserNotAuthorizedException,
234
288
  ) as e:
235
289
  console.print_exception()
236
- console.print("\n\n ======> Most likely the GUID you provided is either incorrect or not an asset\n[red bold]")
290
+ console.print(
291
+ "\n\n ======> Most likely the GUID you provided is either incorrect or not an asset\n[red bold]"
292
+ )
237
293
 
238
294
 
239
295
  def main():
@@ -252,7 +308,7 @@ def main():
252
308
  try:
253
309
  asset_guid = Prompt.ask("Enter the Asset GUID to view:", default="")
254
310
  asset_viewer(asset_guid, server, url, userid, user_pass)
255
- except (KeyboardInterrupt) as e:
311
+ except KeyboardInterrupt as e:
256
312
  # console.print_exception()
257
313
  pass
258
314
  except Exception as e:
@@ -71,8 +71,9 @@ def display_archive_list(
71
71
  )
72
72
 
73
73
  table.add_column("Name")
74
+ table.add_column("Description")
74
75
  table.add_column("Path Name")
75
- table.add_column("Creation Date")
76
+
76
77
  # table.add_column("Creator")
77
78
  # table.add_column("Description")
78
79
 
@@ -93,16 +94,14 @@ def display_archive_list(
93
94
  for archive in sorted_archives:
94
95
  name = archive["properties"].get("name", "---")
95
96
  path_name = archive["properties"].get("pathName", "---")
97
+ description = archive["properties"].get("description", "---")
96
98
  creation_date_epoch = (
97
99
  int(archive["properties"].get("storeCreateTime", 0)) / 1000
98
100
  )
99
101
  create_date = datetime.datetime.fromtimestamp(creation_date_epoch)
100
102
  creator = "---"
101
- description = "---"
102
103
 
103
- table.add_row(
104
- name, path_name, create_date.strftime("%Y-%m-%d %H:%M:%S")
105
- )
104
+ table.add_row(name, description, path_name)
106
105
 
107
106
  return table
108
107
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.8.4.38
3
+ Version: 0.8.4.39
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -1,12 +1,12 @@
1
1
  commands/cat/README.md,sha256=-aaAnIT2fcfU63vajgB-RzQk4l4yFdhkyVfSaTPiqRY,967
2
2
  commands/cat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- commands/cat/get_asset_graph.py,sha256=5YwgV4D1_R9pptPJuIFbPOjWpZBnfPiEan33_To75TE,11194
3
+ commands/cat/get_asset_graph.py,sha256=4AO4KlCgb7vbMihJK7W_GAnrd4J9sKwc4kXxa2ZrRW4,12447
4
4
  commands/cat/get_collection.py,sha256=v7hCeEDcAQmcjM9qepuk8gg_RnYra3_v009AJOunkKk,5005
5
5
  commands/cat/get_project_dependencies.py,sha256=B0JaMSUi0hzVgos1sTY2uUPGy1DzKEJMIbbYfMUWvQA,5981
6
6
  commands/cat/get_project_structure.py,sha256=n2GbNd07w1DTo7jTR8b2ewXRyNcat_2BcCBRyDMldwk,5969
7
7
  commands/cat/get_tech_type_elements.py,sha256=-m3Q0BoNqkCtV8h75vMwTcOV-_ymEXmnJcr4Ec7WMAw,6180
8
8
  commands/cat/get_tech_type_template.py,sha256=gMFVcgCIm09GQu1Vsc5ZUVH9XLhItAG1eVGZJrcnHeQ,6174
9
- commands/cat/list_archives.py,sha256=E45WMqAUuaEL6vwHGMfbpoUm3C7CyW46pIFcRc0Yfbs,5481
9
+ commands/cat/list_archives.py,sha256=83LhNeZWhzRiE-oU6veuIk9ob4XDtDWUoXdGGXaYeE8,5454
10
10
  commands/cat/list_assets.py,sha256=bNwSaBDz661hfnc2Rn4j4HPHAugKvz0XwN9L1m4FVQk,6529
11
11
  commands/cat/list_cert_types.py,sha256=mbCls_EqC5JKG5rvS4o69k7KgZ6aNXlcqoJ3DtHsTFA,7127
12
12
  commands/cat/list_glossary.py,sha256=tUtQQoTGTlDLU-yFbfO3zjiJC9QyEJfg8NxnGCo2mnI,5811
@@ -91,8 +91,8 @@ pyegeria/server_operations.py,sha256=ciH890hYT85YQ6OpByn4w7s3a7TtvWZpIG5rkRqbcI0
91
91
  pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
92
92
  pyegeria/valid_metadata_omvs.py,sha256=raBU_bK0oMhOqjOUTSbU_OZuGKsYqRoiFbtUwz4OtZI,29060
93
93
  pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
94
- pyegeria-0.8.4.38.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
95
- pyegeria-0.8.4.38.dist-info/METADATA,sha256=P-ouAO_QVuOuzKDCaBsp7p7ipcbMeNCF1vHAlfYu7D0,2868
96
- pyegeria-0.8.4.38.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
97
- pyegeria-0.8.4.38.dist-info/entry_points.txt,sha256=R8sNzclWZN542SufuVlx9HDia23PlSVnJioUkzCWg4I,3349
98
- pyegeria-0.8.4.38.dist-info/RECORD,,
94
+ pyegeria-0.8.4.39.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
95
+ pyegeria-0.8.4.39.dist-info/METADATA,sha256=E77MPfsyC_PUoY4zSE6pzkmLjUI_UbJku8y23jQZ6_g,2868
96
+ pyegeria-0.8.4.39.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
97
+ pyegeria-0.8.4.39.dist-info/entry_points.txt,sha256=R8sNzclWZN542SufuVlx9HDia23PlSVnJioUkzCWg4I,3349
98
+ pyegeria-0.8.4.39.dist-info/RECORD,,