pyegeria 0.7.7__py3-none-any.whl → 0.7.9__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.
@@ -50,7 +50,6 @@ from examples.widgets.tech.list_registered_services import display_registered_sv
50
50
  from examples.widgets.tech.list_relationship_types import display_relationship_types
51
51
  from examples.widgets.tech.list_tech_templates import display_templates_spec
52
52
  from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
53
- from examples.widgets.tech.get_element_info import display_elements
54
53
  from examples.widgets.tech.list_elements import list_elements
55
54
 
56
55
  @tui()
@@ -196,14 +195,6 @@ def show(ctx):
196
195
  """Display an Egeria Object"""
197
196
  pass
198
197
 
199
- @show.command("get-element-info")
200
- @click.pass_context
201
- @click.option('--om_type', default='Project', help='Metadata type to query')
202
- def get_element_info(ctx, om_type):
203
- """Display the valid metadata values for a property and type"""
204
- c = ctx.obj
205
- display_elements(om_type, c.view_server, c.view_server_url,
206
- c.userid, c.password, c.jupyter, c.width)
207
198
 
208
199
  @show.command("list-elements")
209
200
  @click.pass_context
@@ -681,7 +672,13 @@ def engine_host(ctx):
681
672
  engine_host.add_command(start_engine_host)
682
673
  engine_host.add_command(stop_engine_host)
683
674
 
684
- tell.add_command(load_archive)
675
+ @tell.group('repository')
676
+ @click.pass_context
677
+ def repository(ctx):
678
+ """Group of commands to a repository"""
679
+ pass
680
+
681
+ repository.add_command(load_archive)
685
682
 
686
683
  if __name__ == '__main__':
687
684
  cli()
@@ -245,7 +245,14 @@ def engine_host(ctx):
245
245
  engine_host.add_command(start_engine_host)
246
246
  engine_host.add_command(stop_engine_host)
247
247
 
248
- tell.add_command(load_archive)
248
+ @tell.group('repository')
249
+ @click.pass_context
250
+ def repository(ctx):
251
+ """Group of commands to a repository"""
252
+ pass
253
+
254
+ repository.add_command(load_archive)
255
+
249
256
 
250
257
  if __name__ == '__main__':
251
258
  cli()
@@ -22,7 +22,6 @@ from examples.widgets.tech.list_relationship_types import display_relationship_t
22
22
  from examples.widgets.tech.list_tech_templates import display_templates_spec
23
23
  from examples.widgets.tech.list_valid_metadata_values import display_metadata_values
24
24
  from examples.widgets.cat.get_tech_type_template import template_viewer
25
- from examples.widgets.tech.get_element_info import display_elements
26
25
  from examples.widgets.tech.list_elements import list_elements
27
26
 
28
27
 
@@ -207,18 +206,10 @@ def valid_metadata_values(ctx, property, type_name):
207
206
  display_metadata_values(property, type_name, c.view_server, c.view_server_url,
208
207
  c.userid, c.password, False, c.jupyter, c.width)
209
208
 
210
- @show.command("get-element-info")
211
- @click.pass_context
212
- @click.option('--om_type', default='Project', help='Metadata type to query')
213
- def get_element_info(ctx, om_type):
214
- """Display the valid metadata values for a property and type"""
215
- c = ctx.obj
216
- display_elements(om_type, c.view_server, c.view_server_url,
217
- c.userid, c.password, c.jupyter, c.width)
218
209
 
219
- @show.command("list-elements")
210
+ @show.command('list-elements')
220
211
  @click.pass_context
221
- @click.option('--om_type', default='Project', help='Metadata type to query')
212
+ @click.option('--om_type', default='Organization', help='Metadata type to query')
222
213
  def get_element_info(ctx, om_type):
223
214
  """Display the valid metadata values for a property and type"""
224
215
  c = ctx.obj
@@ -59,6 +59,7 @@ def list_elements(om_type:str, server: str,
59
59
  )
60
60
 
61
61
  table.add_column("Qualified Name")
62
+ table.add_column("Type")
62
63
  table.add_column("Created")
63
64
  table.add_column("Home Store")
64
65
  table.add_column("GUID", width = 38,no_wrap=True)
@@ -68,7 +69,7 @@ def list_elements(om_type:str, server: str,
68
69
  if type(elements) is list:
69
70
  for element in elements:
70
71
  header = element['elementHeader']
71
- el_q_name = element['properties']['qualifiedName']
72
+ el_q_name = element['properties'].get('qualifiedName',"---")
72
73
  el_type = header["type"]['typeName']
73
74
  el_home = header['origin']['homeMetadataCollectionName']
74
75
  el_create_time = header['versions']['createTime'][:-10]
@@ -79,11 +80,11 @@ def list_elements(om_type:str, server: str,
79
80
  el_props_md += f"* **{prop}**: {element['properties'][prop]}\n"
80
81
 
81
82
  el_props_out = Markdown(el_props_md)
82
- table.add_row(el_q_name, el_create_time, el_home, el_guid, el_props_out)
83
+ table.add_row(el_q_name, el_type, el_create_time, el_home, el_guid, el_props_out)
83
84
 
84
85
  return table
85
86
  else:
86
- print("Unknown Open Metadata type")
87
+ print("No instances found")
87
88
  sys.exit(1)
88
89
 
89
90
  try:
@@ -94,7 +95,7 @@ def list_elements(om_type:str, server: str,
94
95
 
95
96
  except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
96
97
  print_exception_response(e)
97
- assert e.related_http_code != "200", "Invalid parameters"
98
+ print("Perhaps the type name isn't known")
98
99
  finally:
99
100
  c_client.close_session()
100
101
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.7.7
3
+ Version: 0.7.9
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -14,11 +14,11 @@ examples/widgets/cat/list_projects.py,sha256=jP6HoVqGi-w4R1itgdAW1zamPLsgkvjvh8r
14
14
  examples/widgets/cat/list_tech_types.py,sha256=20T4v6L5qeebSsaL1nGkFMDAIsy2W3A3SMm1RcgFoh0,4609
15
15
  examples/widgets/cat/list_todos.py,sha256=wD9HevGcc4G_bxV25VUz1rRssdZHE33mF5zmJ6Lprt8,5522
16
16
  examples/widgets/cli/__init__.py,sha256=6d_R0KZBNnJy9EBz9J2xvGFlx-3j_ZPqPCxKgdvYeDQ,291
17
- examples/widgets/cli/egeria.py,sha256=WGq_GZbOQMLvY_Oi_aox6iN049qdfr6Yw80gvjfQD9Y,23777
17
+ examples/widgets/cli/egeria.py,sha256=WTGHf1tJHq3IPiGada2QH1mMWggNrEIlXPFxjDR6Lew,23450
18
18
  examples/widgets/cli/egeria_cat.py,sha256=f9KxOPAEFbeEtSAdk_czcBDLqCKsHkrpdiBuDDo-iUw,10301
19
19
  examples/widgets/cli/egeria_my.py,sha256=xi2j1hzNnjDruJeR1qa8K9JPDgzaL_COsMkcieT4Vo8,5653
20
- examples/widgets/cli/egeria_ops.py,sha256=ZOIQdpRZ5VgL282OpjNVmXvxxmmVxnOaEGF0sNIpzF0,10011
21
- examples/widgets/cli/egeria_tech.py,sha256=xcDvd7TcpOKsLxDYOvSq3FWiK6_slO3oAnwDvyvPkGE,9801
20
+ examples/widgets/cli/egeria_ops.py,sha256=Y2fNDFnaaMjt8vjOeUXneh4_WEyxp0ucMvIfdLn8Bik,10139
21
+ examples/widgets/cli/egeria_tech.py,sha256=EgerEUaaFOzIixYRhI79IKfVMEVQZ37RjX62aVbNPXc,9352
22
22
  examples/widgets/cli/ops_config.py,sha256=m4AfPjf-fR4EBTx8Dc2mcgrfWwAxb30YGeV-v79bg4U,1450
23
23
  examples/widgets/my/README.md,sha256=ZheFhj_VoPMhcWjW3pGchHB0vH_A9PklSmrSkzKdrcQ,844
24
24
  examples/widgets/my/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -45,11 +45,10 @@ examples/widgets/ops/refresh_integration_daemon.py,sha256=QDB3dpAlLY8PhrGhAZG4tW
45
45
  examples/widgets/ops/restart_integration_daemon.py,sha256=fID7qGFL5RD6rfn9PgXf5kwI4MU0Ho_IGXnDVbKT5nU,2710
46
46
  examples/widgets/tech/README.md,sha256=nxDnfr3BCiGgW5G1VxWxiwUWJXIe5wreNuUeRyIt_hY,1343
47
47
  examples/widgets/tech/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- examples/widgets/tech/get_element_info.py,sha256=zhgnsCRuw-rWwo4QVrVfzwfFqksj21QglSMJxY064Kw,4620
49
48
  examples/widgets/tech/get_guid_info.py,sha256=p-peTX1Mahi8fNmcNVHOVI3OjqjlJwZjv7gRdBI4l0Q,4137
50
49
  examples/widgets/tech/get_tech_details.py,sha256=b7i3kSTaZ2pZPcxkDccqY27bqeHJoYnPCxOvlKPH0hw,5753
51
50
  examples/widgets/tech/list_asset_types.py,sha256=PHPtCXqCHhIw0K59hUvoKdybp6IKPt_9Wc0AJVDtdrg,4181
52
- examples/widgets/tech/list_elements.py,sha256=OsxovF9igZy57PsqYZE7nYfJyI2YGvLtipSQuKW_fx8,4697
51
+ examples/widgets/tech/list_elements.py,sha256=xQg-PGS2oORed2ATVNPZvGVCGLEUHO5rOeXvgS6pkrg,4726
53
52
  examples/widgets/tech/list_registered_services.py,sha256=TqZbT54vMGvHUAX_bovCce3A3eV_RbjSEtPP6u6ZJV0,6388
54
53
  examples/widgets/tech/list_relationship_types.py,sha256=0T8Sl7J3WFq_0IQLLzcL0T79pUxVENWNT95Cpjz2ukc,5633
55
54
  examples/widgets/tech/list_tech_templates.py,sha256=RiyA8a4fIL9BGeGf37Bkk471mK5ECkDJMN9QVNReC1M,6192
@@ -80,8 +79,8 @@ pyegeria/runtime_manager_omvs.py,sha256=oSVFeG_yBGXIvQR0EClLZqTZ6C5z5ReZzwm8cce8
80
79
  pyegeria/server_operations.py,sha256=1z2wZLdrNZG6HlswY_Eh8qI1mlcjsQ59zO-AMy9XbUU,16605
81
80
  pyegeria/utils.py,sha256=pkVmS3RrbjaS9yz7FtOCwaOfV5FMqz-__Rt5koCnd9c,5374
82
81
  pyegeria/valid_metadata_omvs.py,sha256=aisdRodIwJSkyArAzfm_sEnBELh69xE8k4Nea-vHu8M,36745
83
- pyegeria-0.7.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
84
- pyegeria-0.7.7.dist-info/METADATA,sha256=SIG-wWB13mXFRst7fWJbhZfOmb6O5wNB7VF5t5-DEQs,2774
85
- pyegeria-0.7.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
86
- pyegeria-0.7.7.dist-info/entry_points.txt,sha256=UJ9j8ILCKryCUhbEIktWwLvJf0Isbuvpxv4TExaHJiA,2859
87
- pyegeria-0.7.7.dist-info/RECORD,,
82
+ pyegeria-0.7.9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
83
+ pyegeria-0.7.9.dist-info/METADATA,sha256=6y1EkUkw5PUG_EARfoPX1FW30rAG1ykLdptDHjsvIqo,2774
84
+ pyegeria-0.7.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
85
+ pyegeria-0.7.9.dist-info/entry_points.txt,sha256=UJ9j8ILCKryCUhbEIktWwLvJf0Isbuvpxv4TExaHJiA,2859
86
+ pyegeria-0.7.9.dist-info/RECORD,,
@@ -1,121 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- SPDX-Lic
4
- ense-Identifier: Apache-2.0
5
- Copyright Contributors to the ODPi Egeria project.
6
-
7
- Unit tests for the Utils helper functions using the Pytest framework.
8
-
9
-
10
- A simple display for glossary terms
11
- """
12
- import argparse
13
- import json
14
- import os
15
- import sys
16
-
17
- from rich import print, box
18
- from rich.console import Console
19
- from rich.markdown import Markdown
20
- from rich.panel import Panel
21
-
22
- from rich.prompt import Prompt
23
- from rich.text import Text
24
- from rich.tree import Tree
25
-
26
- from pyegeria import (
27
- InvalidParameterException,
28
- PropertyServerException,
29
- UserNotAuthorizedException,
30
- Client, ClassificationManager
31
- )
32
-
33
-
34
- EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
35
- EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
36
- EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
37
- EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
38
- EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
39
- EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
40
- EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
41
- EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
42
- EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
43
- EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
44
- EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
45
- EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
46
-
47
-
48
- def display_elements(om_type: str, server: str, url: str, username: str, user_password: str,
49
- jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH
50
- ):
51
- c = ClassificationManager(server, url, user_id=username, user_pwd=user_password)
52
-
53
- bearer_token = c.create_egeria_bearer_token(username, user_password)
54
-
55
- try:
56
- console = Console(width=width, force_terminal=not jupyter, style="bold white on black")
57
- r = c.get_elements(om_type)
58
- if type(r) is not list:
59
- print(f"\n\n\tno elements found: {r}")
60
- sys.exit(1)
61
-
62
- tree = Tree(f"Elements for Open Metadata Type:{om_type}\n* There are {len(r)} elements", style="bold bright_white on black",
63
- guide_style="bold bright_blue")
64
- t = tree.add(f"Elements for {om_type}", style="bold bright_white on black")
65
- for element in r:
66
- header = element['elementHeader']
67
- el_type = header["type"]['typeName']
68
- el_home = header['origin']['homeMetadataCollectionName']
69
- el_create_time = header['versions']['createTime']
70
- el_guid = header['guid']
71
-
72
- el_md = (f"#### Element Basics\n"
73
- f"* **Type**: {el_type}\n"
74
- f"* **Home**: {el_home}\n"
75
- f"* **Created**: {el_create_time}\n"
76
- f"* **GUID**: {el_guid}\n ---\n")
77
- for prop in element['properties'].keys():
78
- el_md += f"* **{prop}**: {element['properties'][prop]}\n"
79
-
80
- el_out = Markdown(el_md)
81
- p = Panel.fit(el_out, title=element['properties']['qualifiedName'],
82
- style = "bold white on black")
83
- t = tree.add(p)
84
-
85
- print(tree)
86
-
87
- c.close_session()
88
-
89
- except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ValueError) as e:
90
- if type(e) is str:
91
- console.print_exception()
92
- else:
93
- # console.print_exception(show_locals=True)
94
- console.print(f"\n ===> Looks like the type {om_type} isn't known...\n")
95
-
96
-
97
-
98
- def main():
99
- parser = argparse.ArgumentParser()
100
- parser.add_argument("--server", help="Name of the server to display status for")
101
- parser.add_argument("--url", help="URL Platform to connect to")
102
- parser.add_argument("--userid", help="User Id")
103
- parser.add_argument("--password", help="User Password")
104
-
105
- # parser.add_argument("--sponsor", help="Name of sponsor to search")
106
- args = parser.parse_args()
107
-
108
- server = args.server if args.server is not None else EGERIA_VIEW_SERVER
109
- url = args.url if args.url is not None else EGERIA_VIEW_SERVER_URL
110
- userid = args.userid if args.userid is not None else EGERIA_USER
111
- user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
112
-
113
- try:
114
- om_type = Prompt.ask("Enter the Open Metadata Type to find Elements for", default=None)
115
- display_elements(om_type, server, url, userid, user_pass)
116
- except (KeyboardInterrupt):
117
- pass
118
-
119
-
120
- if __name__ == "__main__":
121
- main()