pyegeria 1.5.1.1.41__py3-none-any.whl → 1.5.1.1.42__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.
@@ -19,38 +19,61 @@ from pyegeria import (
19
19
  PropertyServerException,
20
20
  UserNotAuthorizedException,
21
21
  print_exception_response,
22
- RegisteredInfo
22
+ RegisteredInfo,
23
23
  )
24
24
  from textual.widgets import DataTable
25
25
 
26
26
  console = Console()
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
- def add_row(table: Union[Table,DataTable], name: str, template_name:str, template_guid: str,
41
- placeholder_table: Table) -> Table | DataTable:
42
- if isinstance(table, Table):
43
- table.add_row(name, template_name, template_guid, placeholder_table)
44
- elif isinstance(table, DataTable):
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
+ # def add_row(table: Union[Table,DataTable], name: str, template_name:str, template_guid: str,
43
+ # placeholder_table: Table) -> Table | DataTable:
44
+ # if isinstance(table, Table):
45
+ # table.add_row(name, template_name, template_guid, placeholder_table)
46
+ # elif isinstance(table, DataTable):
47
+ # table.add_row(name, template_name, template_guid, placeholder_table)
48
+ #
49
+ # return table
50
+
51
+
52
+ def add_row(
53
+ table: Union[Table, DataTable],
54
+ name: str,
55
+ template_name: str,
56
+ template_guid: str,
57
+ placeholder_table: Table,
58
+ ) -> Table | DataTable:
59
+ if placeholder_table:
45
60
  table.add_row(name, template_name, template_guid, placeholder_table)
46
-
61
+ else:
62
+ table.add_row(name, template_name, template_guid)
47
63
  return table
48
64
 
49
- def display_templates_spec(search_string:str, server: str,
50
- url: str, username: str, password: str, jupyter:bool=EGERIA_JUPYTER,
51
- width:int = EGERIA_WIDTH, data_table: bool = False
52
- )-> Table | DataTable:
53
65
 
66
+ def display_templates_spec(
67
+ search_string: str,
68
+ server: str,
69
+ url: str,
70
+ username: str,
71
+ password: str,
72
+ jupyter: bool = EGERIA_JUPYTER,
73
+ width: int = EGERIA_WIDTH,
74
+ data_table: bool = False,
75
+ placeholders: bool = False,
76
+ ) -> Table | DataTable:
54
77
  a_client = AutomatedCuration(server, url, username)
55
78
  nest_asyncio.apply()
56
79
  token = a_client.create_egeria_bearer_token(username, password)
@@ -78,21 +101,21 @@ def display_templates_spec(search_string:str, server: str,
78
101
 
79
102
  table.add_column("Name", width=20)
80
103
  table.add_column("Template Name", width=20)
81
- table.add_column("Template GUID", width = 38,no_wrap=True)
82
- table.add_column("Placeholders")
83
-
104
+ table.add_column("Template GUID", width=38, no_wrap=True)
105
+ if placeholders:
106
+ table.add_column("Placeholders")
84
107
 
85
108
  if type(tech_list) is list:
86
109
  for item in tech_list:
87
- if 'deployedImplementationType' not in item['qualifiedName']:
110
+ if "deployedImplementationType" not in item["qualifiedName"]:
88
111
  continue
89
- placeholder_table = Table(expand=False, show_lines=True)
90
- placeholder_table.add_column("Name", width = 20,no_wrap=True)
91
- placeholder_table.add_column("Type", width = 10)
92
- placeholder_table.add_column("Required", width = 10)
93
- placeholder_table.add_column("Example", width = 20)
94
- placeholder_table.add_column("Description", width = 40)
95
-
112
+ # if placeholders:
113
+ # placeholder_table = Table(expand=False, show_lines=True)
114
+ # placeholder_table.add_column("Name", width = 20,no_wrap=True)
115
+ # placeholder_table.add_column("Type", width = 10)
116
+ # placeholder_table.add_column("Required", width = 10)
117
+ # placeholder_table.add_column("Example", width = 20)
118
+ # placeholder_table.add_column("Description", width = 40)
96
119
 
97
120
  name = item.get("name", "none")
98
121
 
@@ -106,22 +129,51 @@ def display_templates_spec(search_string:str, server: str,
106
129
  for template in templates:
107
130
  template_name = template.get("name", None)
108
131
 
109
- template_name = f"{name}_Template" if template_name is None else template_name
132
+ template_name = (
133
+ f"{name}_Template"
134
+ if template_name is None
135
+ else template_name
136
+ )
110
137
 
111
138
  specification = template["specification"]["placeholderProperty"]
112
139
  template_guid = template["relatedElement"]["guid"]
113
-
114
- for placeholder in specification:
115
- placeholder_data_type = placeholder["dataType"]
116
- placeholder_description = placeholder["description"]
117
- placeholder_name = placeholder["placeholderPropertyName"]
118
- placeholder_required = placeholder["required"]
119
- placeholder_example = placeholder.get("example", None)
120
- placeholder_table.add_row(placeholder_name, placeholder_data_type, placeholder_required,
121
- placeholder_example, placeholder_description,)
140
+ if placeholders:
141
+ placeholder_table = Table(expand=False, show_lines=True)
142
+ placeholder_table.add_column("Name", width=20, no_wrap=True)
143
+ placeholder_table.add_column("Type", width=10)
144
+ placeholder_table.add_column("Required", width=10)
145
+ placeholder_table.add_column("Example", width=20)
146
+ placeholder_table.add_column("Description", width=40)
147
+
148
+ for placeholder in specification:
149
+ placeholder_data_type = placeholder["dataType"]
150
+ placeholder_description = placeholder["description"]
151
+ placeholder_name = placeholder[
152
+ "placeholderPropertyName"
153
+ ]
154
+ placeholder_required = placeholder["required"]
155
+ placeholder_example = placeholder.get("example", None)
156
+ placeholder_table.add_row(
157
+ placeholder_name,
158
+ placeholder_data_type,
159
+ placeholder_required,
160
+ placeholder_example,
161
+ placeholder_description,
162
+ )
163
+ table = add_row(
164
+ table,
165
+ name,
166
+ template_name,
167
+ template_guid,
168
+ placeholder_table,
169
+ )
170
+ else:
171
+ table = add_row(
172
+ table, name, template_name, template_guid, None
173
+ )
122
174
 
123
175
  # table.add_row(name, template_name, template_guid, placeholder_table)
124
- table = add_row(table, name, template_name, template_guid, placeholder_table)
176
+ # table = add_row(table, name, template_name, template_guid, placeholder_table)
125
177
 
126
178
  return table
127
179
  else:
@@ -137,7 +189,11 @@ def display_templates_spec(search_string:str, server: str,
137
189
  with console.pager(styles=True):
138
190
  console.print(generate_table(data_table))
139
191
 
140
- except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
192
+ except (
193
+ InvalidParameterException,
194
+ PropertyServerException,
195
+ UserNotAuthorizedException,
196
+ ) as e:
141
197
  print_exception_response(e)
142
198
  assert e.related_http_code != "200", "Invalid parameters"
143
199
  finally:
@@ -160,14 +216,21 @@ def main():
160
216
  guid = None
161
217
 
162
218
  try:
163
- search_string = Prompt.ask("Enter the technology you are searching for:", default="*")
164
- display_templates_spec(search_string, server, url, userid, password,data_table=False)
165
- except(KeyboardInterrupt):
219
+ search_string = Prompt.ask(
220
+ "Enter the technology you are searching for:", default="*"
221
+ )
222
+ display_templates_spec(
223
+ search_string,
224
+ server,
225
+ url,
226
+ userid,
227
+ password,
228
+ data_table=False,
229
+ placeholders=True,
230
+ )
231
+ except KeyboardInterrupt:
166
232
  pass
167
233
 
168
234
 
169
235
  if __name__ == "__main__":
170
236
  main()
171
-
172
-
173
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 1.5.1.1.41
3
+ Version: 1.5.1.1.42
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -84,7 +84,7 @@ pyegeria/commands/tech/list_related_specification.py,sha256=mWrKenXOskL4cl0DHjH2
84
84
  pyegeria/commands/tech/list_relationship_types.py,sha256=BlVzrPznZXqMVLN2-2vYEVRGeYsiJrqXxIJEikobyoo,5875
85
85
  pyegeria/commands/tech/list_tech_templates.py,sha256=FIeYWnJY2bVUrfDQBJX2bpkp5cU7uPak52eJtB4vVu4,14146
86
86
  pyegeria/commands/tech/list_valid_metadata_values.py,sha256=N3D0_BmREPszgde3uvvYdfzq7DJ46uMOv2t1vtncGsw,6333
87
- pyegeria/commands/tech/table_tech_templates.py,sha256=xa_mA10P_6Su3zRsvyoZhWoSUQ5LuyLTG1kNCumzxZA,7268
87
+ pyegeria/commands/tech/table_tech_templates.py,sha256=_aWI4U8CMO0c2JdUxfqW7b2RQADMPUBvTulWk6m50VA,9318
88
88
  pyegeria/commands/tech/x_list_related_elements.py,sha256=qBsf1619cecaMCTzG0MG22fAT32WNH2Z3CXrjo9z-5Y,5853
89
89
  pyegeria/core_omag_server_config.py,sha256=EtHaPKyc9d6pwTgbnQqGwe5lSBMPIfJOlbJEa1zg1JA,94946
90
90
  pyegeria/create_tech_guid_lists.py,sha256=HHkC6HW58EN1BiolrYSRqSE0JhPbTepOFzwtdwBxVaU,4640
@@ -108,8 +108,8 @@ pyegeria/template_manager_omvs.py,sha256=heqbKeum5hPCHap4r1RUZU8YB3QaQlxVNbq4GZi
108
108
  pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
109
109
  pyegeria/valid_metadata_omvs.py,sha256=tfCGXed5LLt59YA8uZNNtd9UJ-lRZfPU_uZxK31Yux0,65069
110
110
  pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
111
- pyegeria-1.5.1.1.41.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
112
- pyegeria-1.5.1.1.41.dist-info/METADATA,sha256=2lAWE0yxT09ZUzU9l43_gmnpXWeAFkohHyPdLGPjkY8,2998
113
- pyegeria-1.5.1.1.41.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
114
- pyegeria-1.5.1.1.41.dist-info/entry_points.txt,sha256=2aD67PkxIfXQqrZfgEwEYdfohKG9zmE5LmuDGURaIDw,5051
115
- pyegeria-1.5.1.1.41.dist-info/RECORD,,
111
+ pyegeria-1.5.1.1.42.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
112
+ pyegeria-1.5.1.1.42.dist-info/METADATA,sha256=F67TiVCEAVeXCtQuUIl1TA7pxBkEdX6Q2lgpQzNcpy0,2998
113
+ pyegeria-1.5.1.1.42.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
114
+ pyegeria-1.5.1.1.42.dist-info/entry_points.txt,sha256=2aD67PkxIfXQqrZfgEwEYdfohKG9zmE5LmuDGURaIDw,5051
115
+ pyegeria-1.5.1.1.42.dist-info/RECORD,,