pyegeria 0.7.30__py3-none-any.whl → 0.7.31__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.
@@ -22,37 +22,49 @@ from pyegeria import (
22
22
  InvalidParameterException,
23
23
  PropertyServerException,
24
24
  UserNotAuthorizedException,
25
- ClassificationManager
25
+ ClassificationManager,
26
26
  )
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'))
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"))
40
42
 
41
43
 
42
44
  disable_ssl_warnings = True
43
45
 
44
46
 
45
- def list_relationships(search_string: str, server: str, url: str, username: str, user_password: str, time_out: int = 60,
46
- jupyter: bool = EGERIA_JUPYTER, width: int = EGERIA_WIDTH):
47
-
47
+ def list_relationships(
48
+ search_string: str,
49
+ server: str,
50
+ url: str,
51
+ username: str,
52
+ user_password: str,
53
+ time_out: int = 60,
54
+ jupyter: bool = EGERIA_JUPYTER,
55
+ width: int = EGERIA_WIDTH,
56
+ ):
48
57
  console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
49
- if (search_string is None) or ((len(search_string) < 3)) and (search_string != '*'):
50
- raise ValueError("Invalid Search String - must be greater than four characters long")
51
- g_client = ClassificationManager(server, url, user_id=username,user_pwd=user_password)
58
+ if (search_string is None) or ((len(search_string) < 3)) and (search_string != "*"):
59
+ raise ValueError(
60
+ "Invalid Search String - must be greater than four characters long"
61
+ )
62
+ g_client = ClassificationManager(
63
+ server, url, user_id=username, user_pwd=user_password
64
+ )
52
65
  token = g_client.create_egeria_bearer_token(username, user_password)
53
66
 
54
-
55
- def generate_table(search_string:str = None) -> Table:
67
+ def generate_table(search_string: str = None) -> Table:
56
68
  """Make a new table."""
57
69
  table = Table(
58
70
  title=f"Relationship List for {search_string} @ {time.asctime()}",
@@ -64,40 +76,49 @@ def list_relationships(search_string: str, server: str, url: str, username: str,
64
76
  show_lines=True,
65
77
  box=box.ROUNDED,
66
78
  caption=f"View Server '{server}' @ Platform - {url}",
67
- expand=True
79
+ expand=True,
68
80
  )
69
- table.add_column('End 1 Name')
81
+ table.add_column("End 1 Name")
70
82
  table.add_column("End 1 GUID", no_wrap=True)
71
- table.add_column('End 1 Type')
72
- table.add_column('End 2 Name')
83
+ table.add_column("End 1 Type")
84
+ table.add_column("End 2 Name")
73
85
  table.add_column("End 2 GUID", no_wrap=True)
74
86
  table.add_column("End 2 Type")
75
87
  table.add_column("Properties", min_width=40)
76
88
 
77
- rel_list = g_client.get_relationships(search_string, page_size=100, time_out=time_out)
89
+ rel_list = g_client.get_relationships(
90
+ search_string, page_size=100, time_out=time_out
91
+ )
78
92
  if type(rel_list) is str:
79
93
  return table
80
94
 
81
- for rel in rel_list:
82
- end1_name = rel['end1'].get('uniqueName','---')
83
- end1_guid = rel['end1']['guid']
84
- end1_type = rel['end1']['type']['typeName']
85
- end2_name = rel['end2'].get('uniqueName', '---')
86
- end2_guid = rel['end2']['guid']
87
- end2_type = rel['end2']['type']['typeName']
95
+ for rel in rel_list:
96
+ end1_name = rel["end1"].get("uniqueName", "---")
97
+ end1_guid = rel["end1"]["guid"]
98
+ end1_type = rel["end1"]["type"]["typeName"]
99
+ end2_name = rel["end2"].get("uniqueName", "---")
100
+ end2_guid = rel["end2"]["guid"]
101
+ end2_type = rel["end2"]["type"]["typeName"]
88
102
 
89
- rel_md = ''
90
- p_test = rel.get('properties','---')
103
+ rel_md = ""
104
+ p_test = rel.get("properties", "---")
91
105
  if type(p_test) is str:
92
- rel_md = '---'
106
+ rel_md = "---"
93
107
  else:
94
- for key in rel['properties'].keys():
108
+ for key in rel["properties"].keys():
95
109
  rel_md += f"* {key}: {rel['properties'][key]}\n"
96
110
 
97
111
  rel_out = Markdown(rel_md)
98
112
 
99
113
  table.add_row(
100
- end1_name, end1_guid, end1_type, end1_name, end2_guid, end2_type, rel_out)
114
+ end1_name,
115
+ end1_guid,
116
+ end1_type,
117
+ end2_name,
118
+ end2_guid,
119
+ end2_type,
120
+ rel_out,
121
+ )
101
122
 
102
123
  g_client.close_session()
103
124
 
@@ -112,13 +133,18 @@ def list_relationships(search_string: str, server: str, url: str, username: str,
112
133
  with console.pager(styles=True):
113
134
  console.print(generate_table(search_string), soft_wrap=True)
114
135
 
115
-
116
- except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
136
+ except (
137
+ InvalidParameterException,
138
+ PropertyServerException,
139
+ UserNotAuthorizedException,
140
+ ) as e:
117
141
  console.print_exception()
118
142
  sys.exit(1)
119
143
 
120
144
  except ValueError as e:
121
- console.print(f"\n\n====> Invalid Search String - must be greater than four characters long")
145
+ console.print(
146
+ f"\n\n====> Invalid Search String - must be greater than four characters long"
147
+ )
122
148
  sys.exit(1)
123
149
 
124
150
 
@@ -139,10 +165,11 @@ def main():
139
165
  time_out = args.time_out if args.time_out is not None else 60
140
166
  try:
141
167
  # search_string = Prompt.ask("Enter an asset search string:", default="*")
142
- search_string = 'Certification'
168
+ search_string = "Certification"
143
169
  list_relationships(search_string, server, url, userid, user_pass, time_out)
144
- except(KeyboardInterrupt):
170
+ except KeyboardInterrupt:
145
171
  pass
146
172
 
173
+
147
174
  if __name__ == "__main__":
148
- main()
175
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.7.30
3
+ Version: 0.7.31
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -12,7 +12,7 @@ examples/widgets/cat/list_assets.py,sha256=bNwSaBDz661hfnc2Rn4j4HPHAugKvz0XwN9L1
12
12
  examples/widgets/cat/list_cert_types.py,sha256=-FEftRK36pOAXYr8OprvL6T_FcRyVtgfqzSKX74XC5o,7004
13
13
  examples/widgets/cat/list_glossary.py,sha256=ybHFl1qebnE48GqtYaM1Gl26Vs9f9YAPAnrrAHHJqHs,5705
14
14
  examples/widgets/cat/list_projects.py,sha256=7Ia2nwukE62jR9pYUVzR2v6PY4xKoA0yk245CHmYt2I,8005
15
- examples/widgets/cat/list_relationships.py,sha256=lRfnsMUc0KN6Gb3qJoHjAwYGrcvTk3oqQRxln1as9u8,5623
15
+ examples/widgets/cat/list_relationships.py,sha256=U9f78cOi4HyaacqNaFSMq_7rRxVcEczvwPv468GYw3Q,5869
16
16
  examples/widgets/cat/list_tech_types.py,sha256=20T4v6L5qeebSsaL1nGkFMDAIsy2W3A3SMm1RcgFoh0,4609
17
17
  examples/widgets/cat/list_todos.py,sha256=_Pe3h74doX_cOoe0Z5_FvZtETBk3tkw2evfRpRgai5E,6283
18
18
  examples/widgets/cat/list_user_ids.py,sha256=7JinL7rknPbGusIb8ikXKEaV1vvbuvx_WWtbmlfS_DY,5093
@@ -89,8 +89,8 @@ pyegeria/runtime_manager_omvs.py,sha256=oSVFeG_yBGXIvQR0EClLZqTZ6C5z5ReZzwm8cce8
89
89
  pyegeria/server_operations.py,sha256=1z2wZLdrNZG6HlswY_Eh8qI1mlcjsQ59zO-AMy9XbUU,16605
90
90
  pyegeria/utils.py,sha256=pkVmS3RrbjaS9yz7FtOCwaOfV5FMqz-__Rt5koCnd9c,5374
91
91
  pyegeria/valid_metadata_omvs.py,sha256=aisdRodIwJSkyArAzfm_sEnBELh69xE8k4Nea-vHu8M,36745
92
- pyegeria-0.7.30.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
93
- pyegeria-0.7.30.dist-info/METADATA,sha256=GUv23ihEaAeJlNKti02n5h3QumwbjBKoYQN5SEl3V98,2818
94
- pyegeria-0.7.30.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
95
- pyegeria-0.7.30.dist-info/entry_points.txt,sha256=22oy5-EM37ldb_-MPtiJygwXU217h8vb2_zT-7vn-yc,3571
96
- pyegeria-0.7.30.dist-info/RECORD,,
92
+ pyegeria-0.7.31.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
93
+ pyegeria-0.7.31.dist-info/METADATA,sha256=DjRy4TybcwB_KqofC4dIS5-PujxLribbX5QKzheFjZ0,2818
94
+ pyegeria-0.7.31.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
95
+ pyegeria-0.7.31.dist-info/entry_points.txt,sha256=22oy5-EM37ldb_-MPtiJygwXU217h8vb2_zT-7vn-yc,3571
96
+ pyegeria-0.7.31.dist-info/RECORD,,