pyegeria 0.5.0__py3-none-any.whl → 0.5.1__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.
Files changed (64) hide show
  1. examples/doc_samples/Create_Collection_Sample.py +292 -0
  2. examples/doc_samples/Create_Sustainability_Collection_Sample.py +115 -0
  3. examples/widgets/catalog_user/__init__.py +0 -10
  4. examples/widgets/catalog_user/list_assets.py +5 -2
  5. examples/widgets/catalog_user/view_asset_graph.py +15 -11
  6. examples/widgets/catalog_user/view_collection.py +4 -1
  7. examples/widgets/catalog_user/view_glossary.py +5 -2
  8. examples/widgets/developer/get_guid_info.py +5 -7
  9. examples/widgets/developer/get_tech_details.py +10 -21
  10. examples/widgets/developer/list_asset_types.py +4 -1
  11. examples/widgets/developer/list_registered_services.py +4 -1
  12. examples/widgets/developer/list_relationship_types.py +5 -3
  13. examples/widgets/developer/list_tech_templates.py +3 -2
  14. examples/widgets/developer/list_tech_types.py +4 -2
  15. examples/widgets/developer/list_valid_metadata_values.py +14 -12
  16. examples/widgets/operational/__init__.py +7 -0
  17. examples/widgets/operational/get_tech_type_elements.py +4 -1
  18. examples/widgets/operational/get_tech_type_template.py +10 -13
  19. examples/widgets/operational/view_asset_events.py +48 -47
  20. examples/widgets/operational/view_coco_status.py +4 -1
  21. examples/widgets/operational/view_eng_action_status.py +4 -1
  22. examples/widgets/operational/view_gov_eng_status.py +4 -1
  23. examples/widgets/operational/view_integ_daemon_status.py +4 -3
  24. examples/widgets/operational/view_platform_status.py +5 -1
  25. examples/widgets/operational/view_server_list.py +4 -1
  26. examples/widgets/operational/view_server_status.py +6 -1
  27. examples/widgets/personal_organizer/get_my_profile.py +5 -2
  28. examples/widgets/personal_organizer/list_projects.py +5 -3
  29. examples/widgets/personal_organizer/list_todos.py +5 -2
  30. examples/widgets/personal_organizer/view_my_todos.py +7 -10
  31. examples/widgets/personal_organizer/view_open_todos.py +5 -1
  32. {src/pyegeria → pyegeria}/__init__.py +1 -1
  33. {pyegeria-0.5.0.dist-info → pyegeria-0.5.1.dist-info}/METADATA +8 -9
  34. pyegeria-0.5.1.dist-info/RECORD +67 -0
  35. pyegeria-0.5.1.dist-info/entry_points.txt +29 -0
  36. pyegeria-0.5.0.dist-info/RECORD +0 -66
  37. pyegeria-0.5.0.dist-info/entry_points.txt +0 -5
  38. src/pyegeria/config.toml +0 -11
  39. {src/pyegeria → pyegeria}/Xfeedback_manager_omvs.py +0 -0
  40. {src/pyegeria → pyegeria}/Xloaded_resources_omvs.py +0 -0
  41. {src/pyegeria → pyegeria}/_client.py +0 -0
  42. {src/pyegeria → pyegeria}/_deprecated_gov_engine.py +0 -0
  43. {src/pyegeria → pyegeria}/_exceptions.py +0 -0
  44. {src/pyegeria → pyegeria}/_globals.py +0 -0
  45. {src/pyegeria → pyegeria}/_validators.py +0 -0
  46. {src/pyegeria → pyegeria}/action_author_omvs.py +0 -0
  47. {src/pyegeria → pyegeria}/asset_catalog_omvs.py +0 -0
  48. {src/pyegeria → pyegeria}/automated_curation_omvs.py +0 -0
  49. {src/pyegeria → pyegeria}/collection_manager_omvs.py +0 -0
  50. {src/pyegeria → pyegeria}/core_guids.py +0 -0
  51. {src/pyegeria → pyegeria}/core_omag_server_config.py +0 -0
  52. {src/pyegeria → pyegeria}/full_omag_server_config.py +0 -0
  53. {src/pyegeria → pyegeria}/glossary_browser_omvs.py +0 -0
  54. {src/pyegeria → pyegeria}/glossary_manager_omvs.py +0 -0
  55. {src/pyegeria → pyegeria}/my_profile_omvs.py +0 -0
  56. {src/pyegeria → pyegeria}/platform_services.py +0 -0
  57. {src/pyegeria → pyegeria}/project_manager_omvs.py +0 -0
  58. {src/pyegeria → pyegeria}/registered_info.py +0 -0
  59. {src/pyegeria → pyegeria}/runtime_manager_omvs.py +0 -0
  60. {src/pyegeria → pyegeria}/server_operations.py +0 -0
  61. {src/pyegeria → pyegeria}/utils.py +0 -0
  62. {src/pyegeria → pyegeria}/valid_metadata_omvs.py +0 -0
  63. {pyegeria-0.5.0.dist-info → pyegeria-0.5.1.dist-info}/LICENSE +0 -0
  64. {pyegeria-0.5.0.dist-info → pyegeria-0.5.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,292 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+ This sample creates the collection structure show in https://egeria-project.org/types/0/0021-Collections
6
+
7
+ """
8
+
9
+ import time
10
+
11
+ from rich import print
12
+ from rich.console import Console
13
+
14
+ from pyegeria import CollectionManager, InvalidParameterException, PropertyServerException, UserNotAuthorizedException
15
+
16
+ view_server = 'view-server'
17
+ platform_url = 'https://localhost:9443'
18
+ user = 'erinoverview'
19
+ console = Console()
20
+
21
+ try:
22
+ c_client = CollectionManager(view_server, platform_url,
23
+ user_id=user)
24
+
25
+ token = c_client.create_egeria_bearer_token(user, "secret")
26
+ start_time = time.perf_counter()
27
+
28
+ # Create a Data Products Root collection
29
+ anchor_guid = None
30
+ parent_guid = None
31
+ parent_relationship_type_name = None
32
+ parent_at_end1 = False
33
+ display_name = "Digital Products Root"
34
+ description = "This is the root catalog for digital products"
35
+ collection_type = "Digital Products Root"
36
+ is_own_anchor = True
37
+
38
+ response = c_client.create_root_collection(anchor_guid, parent_guid,
39
+ parent_relationship_type_name, parent_at_end1,
40
+ display_name, description, collection_type,
41
+ is_own_anchor)
42
+ # Create first folder for Agriculture Insights
43
+ parent_guid = "97bbfe07-6696-4550-bf8b-6b577d25bef0"
44
+ parent_relationship_type_name = "CollectionMembership"
45
+ display_name = "Agriculture Insights Collection"
46
+ description = "A folder for agricultural insights data product collections"
47
+ collection_type = "Digital Product Marketplace"
48
+
49
+ folder1 = c_client.create_folder_collection(None, parent_guid,
50
+ parent_relationship_type_name,
51
+ True, display_name, description,
52
+ collection_type, True, "DATE_CREATED",
53
+ None
54
+ )
55
+ print(f"\n\n created a folder with guid {folder1}")
56
+ # create second folder for Earth Observations
57
+ display_name = "Earth Observation Data Collection"
58
+ description = "A folder for Earth Observation data product collections"
59
+
60
+ folder2 = c_client.create_folder_collection(None, parent_guid,
61
+ parent_relationship_type_name,
62
+ True, display_name, description,
63
+ collection_type, True, "DATE_CREATED",
64
+ None
65
+ )
66
+ print(f"\n\n created a folder with guid {folder2}")
67
+
68
+ # create a digital product, child of folder 1, for Land Use products
69
+ parent_guid = folder1
70
+ parent_relationship_type_name = "CollectionMembership"
71
+ display_name = "Land Use Classification"
72
+ description = "Land use classification assets"
73
+ collection_type = "Digital Product"
74
+ classification_name = "Digital Product"
75
+ body_3 = {
76
+ "class": "NewDigitalProductRequestBody",
77
+ "isOwnAnchor": True,
78
+ "parentGUID": parent_guid,
79
+ "parentRelationshipTypeName": parent_relationship_type_name,
80
+ "parentAtEnd1": True,
81
+ "collectionProperties": {
82
+ "class": "CollectionProperties",
83
+ "qualifiedName": f"{classification_name}-{display_name}-{time.asctime()}",
84
+ "name": display_name,
85
+ "description": description,
86
+ "collectionType": collection_type,
87
+ "collectionOrdering": "DATE_CREATED",
88
+ },
89
+ "digitalProductProperties": {
90
+ "class": "DigitalProductProperties",
91
+ "productStatus": "ACTIVE",
92
+ "productName": "Land Use Classifications",
93
+ "productType": "Geospatial Data Assets",
94
+ "description": "Land use classification assets",
95
+ "introductionDate": "2023-12-01",
96
+ "maturity": "Nacent",
97
+ "serviceLife": "3 years",
98
+ "currentVersion": "V.5",
99
+ "nextVersionDate": "2024-12-01",
100
+ "withdrawDate": "2030-01-01",
101
+ "additionalProperties": {
102
+ "thought_id": "a guid",
103
+ "license": "cc-by-sa",
104
+ }
105
+ }
106
+ }
107
+ folder3 = c_client.create_digital_product(body_3)
108
+ print(f"\n\n created a collection with guid {folder3}")
109
+
110
+ # create a fourth collection, a digital product, child of folder 2, for Landsat 8
111
+ parent_guid = folder2
112
+ display_name = "Landsat 8"
113
+ description = "Landsat 8 data products"
114
+
115
+ body_4 = {
116
+ "class": "NewDigitalProductRequestBody",
117
+ "isOwnAnchor": True,
118
+ "parentGUID": parent_guid,
119
+ "parentRelationshipTypeName": parent_relationship_type_name,
120
+ "parentAtEnd1": True,
121
+ "collectionProperties": {
122
+ "class": "CollectionProperties",
123
+ "qualifiedName": f"{classification_name}-{display_name}-{time.asctime()}",
124
+ "name": display_name,
125
+ "description": description,
126
+ "collectionType": collection_type,
127
+ "collectionOrdering": "DATE_CREATED",
128
+ },
129
+ "digitalProductProperties": {
130
+ "class": "DigitalProductProperties",
131
+ "productStatus": "ACTIVE",
132
+ "productName": "Landsat 8 Imagery",
133
+ "productType": "Geospatial Data Assets",
134
+ "description": description,
135
+ "introductionDate": "2024-01-01",
136
+ "maturity": "Mature",
137
+ "serviceLife": "3 years",
138
+ "currentVersion": "V1.5",
139
+ "nextVersion": "2024-06-01",
140
+ "withdrawDate": "2030-01-01",
141
+ "additionalProperties": {
142
+ "thought_id": "a guid",
143
+ "license": "cc-by-sa",
144
+ }
145
+ }
146
+ }
147
+ folder4 = c_client.create_digital_product(body_4)
148
+ print(f"\n\n created a collection with guid {folder4}")
149
+
150
+ # Now create a 5th collection for sentinel 2 data
151
+ parent_guid = folder2
152
+ display_name = "Sentinel 2"
153
+ description = "Sentinel 2 products"
154
+ parent_relationship_type_name = "CollectionMembership"
155
+ collection_type = "Digital Product Marketplace"
156
+
157
+ folder5 = c_client.create_folder_collection(None, parent_guid,
158
+ parent_relationship_type_name,
159
+ True, display_name, description,
160
+ collection_type, True, "DATE_CREATED",
161
+ None
162
+ )
163
+ # Create a DigitalProduct for Level-1B
164
+ parent_guid = folder5
165
+ display_name = "Sentinel 2 - Level 1B"
166
+ description = "Level 1B of Sentinel 2"
167
+
168
+ body_6 = {
169
+ "class": "NewDigitalProductRequestBody",
170
+ "anchor_guid": parent_guid,
171
+ "isOwnAnchor": False,
172
+ "parentGUID": parent_guid,
173
+ "parentRelationshipTypeName": parent_relationship_type_name,
174
+ "parentAtEnd1": True,
175
+ "collectionProperties": {
176
+ "class": "CollectionProperties",
177
+ "qualifiedName": f"{classification_name}-{display_name}-{time.asctime()}",
178
+ "name": display_name,
179
+ "description": description,
180
+ "collectionType": collection_type,
181
+ "collectionOrdering": "DATE_CREATED",
182
+ },
183
+ "digitalProductProperties": {
184
+ "class": "DigitalProductProperties",
185
+ "productStatus": "ACTIVE",
186
+ "productName": "Sentinel 2 - Level 1B",
187
+ "productType": "Geospatial Data Assets",
188
+ "description": description,
189
+ "introductionDate": "2024-01-01",
190
+ "maturity": "Mature",
191
+ "serviceLife": "3 years",
192
+ "currentVersion": "V1.5",
193
+ "nextVersion": "2024-06-01",
194
+ "withdrawDate": "2030-01-01",
195
+ "additionalProperties": {
196
+ "thought_id": "a guid",
197
+ "license": "cc-by-sa",
198
+ }
199
+ }
200
+ }
201
+ folder6 = c_client.create_digital_product(body_6)
202
+ print(f"\n\n created a collection with guid {folder6}")
203
+
204
+ # now lets create a digital product for - Level - 1c
205
+ parent_guid = folder5
206
+ display_name = "Sentinel 2 - Level 1C"
207
+ description = "Level 1C of Sentinel 2"
208
+ body_7 = {
209
+ "class": "NewDigitalProductRequestBody",
210
+ "anchor_guid": parent_guid,
211
+ "isOwnAnchor": False,
212
+ "parentGUID": parent_guid,
213
+ "parentRelationshipTypeName": parent_relationship_type_name,
214
+ "parentAtEnd1": True,
215
+ "collectionProperties": {
216
+ "class": "CollectionProperties",
217
+ "qualifiedName": f"{classification_name}-{display_name}-{time.asctime()}",
218
+ "name": display_name,
219
+ "description": description,
220
+ "collectionType": collection_type,
221
+ "collectionOrdering": "DATE_CREATED",
222
+ },
223
+ "digitalProductProperties": {
224
+ "class": "DigitalProductProperties",
225
+ "productStatus": "ACTIVE",
226
+ "productName": "Sentinel 2 - Level 1B",
227
+ "productType": "Geospatial Data Assets",
228
+ "description": description,
229
+ "introductionDate": "2024-01-01",
230
+ "maturity": "Mature",
231
+ "serviceLife": "3 years",
232
+ "currentVersion": "V1.5",
233
+ "nextVersion": "2024-06-01",
234
+ "withdrawDate": "2030-01-01",
235
+ "additionalProperties": {
236
+ "thought_id": "a guid",
237
+ "license": "cc-by-sa",
238
+ }
239
+ }
240
+ }
241
+ folder7 = c_client.create_digital_product(body_7)
242
+ print(f"\n\n created a collection with guid {folder7}")
243
+
244
+ # now let's create a digital product for - Level - 2A
245
+ parent_guid = folder5
246
+ display_name = "Sentinel 2 - Level 2A"
247
+ description = "Level 2A of Sentinel 2"
248
+ body_8 = {
249
+ "class": "NewDigitalProductRequestBody",
250
+ "anchor_guid": parent_guid,
251
+ "isOwnAnchor": False,
252
+ "parentGUID": parent_guid,
253
+ "parentRelationshipTypeName": parent_relationship_type_name,
254
+ "parentAtEnd1": True,
255
+ "collectionProperties": {
256
+ "class": "CollectionProperties",
257
+ "qualifiedName": f"{classification_name}-{display_name}-{time.asctime()}",
258
+ "name": display_name,
259
+ "description": description,
260
+ "collectionType": collection_type,
261
+ "collectionOrdering": "DATE_CREATED",
262
+ },
263
+ "digitalProductProperties": {
264
+ "class": "DigitalProductProperties",
265
+ "productStatus": "ACTIVE",
266
+ "productName": "Sentinel 2 - Level 1B",
267
+ "productType": "Geospatial Data Assets",
268
+ "description": description,
269
+ "introductionDate": "2024-01-01",
270
+ "maturity": "Mature",
271
+ "serviceLife": "3 years",
272
+ "currentVersion": "V1.5",
273
+ "nextVersion": "2024-06-01",
274
+ "withdrawDate": "2030-01-01",
275
+ "additionalProperties": {
276
+ "thought_id": "a guid",
277
+ "license": "cc-by-sa",
278
+ }
279
+ }
280
+ }
281
+ folder8 = c_client.create_digital_product(body_8)
282
+ print(f"\n\n created a collection with guid {folder8}")
283
+
284
+ except (
285
+ InvalidParameterException,
286
+ PropertyServerException,
287
+ UserNotAuthorizedException
288
+ ) as e:
289
+ console.print_exception(show_locals=True)
290
+
291
+ finally:
292
+ c_client.close_session()
@@ -0,0 +1,115 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+ This sample creates a collection structure for a sustainability reporting project. It is
6
+ simplistic but shows how we can set up a collection hierarchy that can hold different kinds of
7
+ assets.
8
+
9
+ """
10
+
11
+ import time
12
+
13
+ from rich import print
14
+ from rich.console import Console
15
+
16
+ from pyegeria import CollectionManager, InvalidParameterException, PropertyServerException, UserNotAuthorizedException
17
+
18
+ view_server = 'view-server'
19
+ platform_url = 'https://localhost:9443'
20
+ user = 'erinoverview'
21
+ console = Console()
22
+
23
+ try:
24
+ c_client = CollectionManager(view_server, platform_url,
25
+ user_id=user)
26
+
27
+ token = c_client.create_egeria_bearer_token(user, "secret")
28
+ start_time = time.perf_counter()
29
+
30
+ # Create a root collection for the sustainability project
31
+ parent_guid = None
32
+ parent_relationship_type_name = None
33
+ display_name = "Root Sustainability Collection"
34
+ description = "The root collection for our sustainability reporting project."
35
+ collection_type = "Sustainability Collection"
36
+
37
+ root = c_client.create_root_collection(None, parent_guid,
38
+ parent_relationship_type_name,
39
+ False, display_name, description,
40
+ collection_type, True)
41
+ print(f"\n\n created a root with guid {root}")
42
+ # create a folder for Scope 1 Emissions
43
+ anchor_guid = root
44
+ parent_guid = root
45
+ parent_relationship_type_name = "CollectionMembership"
46
+ display_name = "Scope 1 Emissions"
47
+ description = "A folder for information about scope 1 emissions."
48
+ collection_type = "Sustainability Collection"
49
+
50
+ scope1_folder = c_client.create_folder_collection(anchor_guid, parent_guid,
51
+ parent_relationship_type_name,
52
+ True, display_name, description,
53
+ collection_type, False, "DATE_CREATED",
54
+ None
55
+ )
56
+ print(f"\n\n created scope1_folder with guid {scope1_folder}")
57
+
58
+ # create a folder for Scope 2 Emissions.
59
+ anchor_guid = root
60
+ parent_guid = root
61
+ parent_relationship_type_name = "CollectionMembership"
62
+ display_name = "Scope 2 Emissions"
63
+ description = "A folder for information about scope 2 emissions."
64
+ collection_type = "Sustainability Collection"
65
+
66
+ scope2_folder = c_client.create_folder_collection(anchor_guid, parent_guid,
67
+ parent_relationship_type_name,
68
+ True, display_name, description,
69
+ collection_type, False, "DATE_CREATED",
70
+ None
71
+ )
72
+ print(f"\n\n created scope2_folder with guid {scope2_folder}")
73
+
74
+ # create a folder for Scope 3 Emissions.
75
+ anchor_guid = root
76
+ parent_guid = root
77
+ parent_relationship_type_name = "CollectionMembership"
78
+ display_name = "Scope 3 Emissions"
79
+ description = "A folder for information about scope 3 emissions."
80
+ collection_type = "Sustainability Collection"
81
+
82
+ scope3_folder = c_client.create_folder_collection(anchor_guid, parent_guid,
83
+ parent_relationship_type_name,
84
+ True, display_name, description,
85
+ collection_type, False, "DATE_CREATED",
86
+ None
87
+ )
88
+ print(f"\n\n created scope3_folder with guid {scope3_folder}")
89
+
90
+ # create a folder for Business Travel Emissions.
91
+ anchor_guid = root
92
+ parent_guid = scope3_folder
93
+ parent_relationship_type_name = "CollectionMembership"
94
+ display_name = "Business Travel Emissions"
95
+ description = "A folder for information about scope 3 business travel emissions."
96
+ collection_type = "Sustainability Collection"
97
+
98
+ travel_folder = c_client.create_folder_collection(anchor_guid, parent_guid,
99
+ parent_relationship_type_name,
100
+ True, display_name, description,
101
+ collection_type, False, "DATE_CREATED",
102
+ None
103
+ )
104
+ print(f"\n\n created travel_folder with guid {travel_folder}")
105
+
106
+
107
+ except (
108
+ InvalidParameterException,
109
+ PropertyServerException,
110
+ UserNotAuthorizedException
111
+ ) as e:
112
+ console.print_exception(show_locals=True)
113
+
114
+ finally:
115
+ c_client.close_session()
@@ -1,10 +0,0 @@
1
- """
2
- SPDX-License-Identifier: Apache-2.0
3
- Copyright Contributors to the ODPi Egeria project.
4
-
5
- catalog user widgets
6
- """
7
- import list_assets
8
- import view_asset_graph
9
- import view_glossary
10
- import view_collection
@@ -118,7 +118,7 @@ def display_assets(search_string: str, guid: str=None, server: str = good_server
118
118
  print_exception_response(e)
119
119
  assert e.related_http_code != "200", "Invalid parameters"
120
120
 
121
- if __name__ == "__main__":
121
+ def main():
122
122
  sus_guid = "f9b78b26-6025-43fa-9299-a905cc6d1575"
123
123
  parser = argparse.ArgumentParser()
124
124
  parser.add_argument("--server", help="Name of the server to display status for")
@@ -135,4 +135,7 @@ if __name__ == "__main__":
135
135
  guid = sus_guid if args.sustainability else None
136
136
 
137
137
  search_string = Prompt.ask("Enter the asset you are searching for:", default="*")
138
- display_assets(search_string, guid,server, url, userid)
138
+ display_assets(search_string, guid,server, url, userid)
139
+
140
+ if __name__ == "__main__":
141
+ main()
@@ -40,7 +40,7 @@ guid_list = []
40
40
 
41
41
  def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str):
42
42
 
43
- def build_classifications(classification: dict) -> str:
43
+ def build_classifications(classification: dict) -> Markdown:
44
44
 
45
45
  class_md = ""
46
46
  for c in classification:
@@ -49,7 +49,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str):
49
49
  continue
50
50
  class_md += f"* Classification: {c_type}\n"
51
51
  class_props = c.get("classificationProperties","---")
52
- if type(class_props) is dict:
52
+ if type(class_props) is list:
53
53
  for prop in class_props.keys():
54
54
  class_md += f"\t* {prop}: {class_props[prop]}\n"
55
55
  if class_md == "":
@@ -125,6 +125,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str):
125
125
  asset_relationships = asset_graph["relationships"]
126
126
  asset_class_md = build_classifications(asset_classifications)
127
127
 
128
+
128
129
  asset_properties = asset_graph["extendedProperties"]
129
130
  prop_md = "\n* Extended Properties:\n"
130
131
  for prop in asset_properties:
@@ -189,24 +190,24 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str):
189
190
  f"* Created by: {relationship_created_by} at time {relationship_creation_time}\n"
190
191
  )
191
192
  rel_end1_md = (
192
- f"\n**End1:**\n"
193
- f"\n\t* Type: {rel_end1_type}\n"
193
+ f"* End1:\n"
194
+ f"\t* Type: {rel_end1_type}\n"
194
195
  f"\t* GUID: {rel_end1_guid}\n"
195
196
  f"\t* Unique Name: {rel_end1_unique_name}\n"
196
197
  )
197
198
 
198
- # if rel_end1_class_md is not None:
199
- # rel_end1_md = rel_end1_md + rel_end1_class_md
199
+ if rel_end1_class_md is not None:
200
+ rel_end1_md = rel_end1_class_md + rel_end1_md
200
201
 
201
202
  rel_end2_md = (
202
- f"\n**End2:**\n"
203
- f"\n\t* Type: {rel_end2_type}\n"
203
+ f"* End2:\n"
204
+ f"\t* Type: {rel_end2_type}\n"
204
205
  f"\t* GUID: {rel_end2_guid}\n"
205
206
  f"\t* Unique Name: {rel_end2_unique_name}\n"
206
207
  )
207
208
 
208
- # if rel_end2_class_md is not None:
209
- # rel_end1_md = rel_end1_md + rel_end2_class_md
209
+ if rel_end2_class_md is not None:
210
+ rel_end1_md = rel_end2_class_md + rel_end1_md
210
211
  #
211
212
  # for prop in relationship_properties.keys():
212
213
  # relationship_md += f"* {prop}: {relationship_properties[prop]}\n"
@@ -228,7 +229,7 @@ def asset_viewer(asset_guid: str, server_name:str, platform_url:str, user:str):
228
229
  print_exception_response(e)
229
230
 
230
231
 
231
- if __name__ == "__main__":
232
+ def main():
232
233
  parser = argparse.ArgumentParser()
233
234
 
234
235
  parser.add_argument("--server", help="Name of the server to display status for")
@@ -242,3 +243,6 @@ if __name__ == "__main__":
242
243
 
243
244
  asset_guid = Prompt.ask("Enter the Asset GUID to view:", default="8e35b39e-6ee7-4d60-aff5-4b09406c5e79")
244
245
  asset_viewer(asset_guid,server, url, userid)
246
+
247
+ if __name__ == "__main__":
248
+ main()
@@ -63,7 +63,7 @@ def collection_viewer(root: str, server_name: str, platform_url: str, user: str)
63
63
  print_exception_response(e)
64
64
 
65
65
 
66
- if __name__ == "__main__":
66
+ def main():
67
67
  parser = argparse.ArgumentParser()
68
68
 
69
69
  parser.add_argument("--server", help="Name of the server to display status for")
@@ -77,3 +77,6 @@ if __name__ == "__main__":
77
77
 
78
78
  root_collection = Prompt.ask("Enter the Root Collection to start from:", default="Digital Products Root")
79
79
  collection_viewer(root_collection, server, url, userid)
80
+
81
+ if __name__ == "__main__":
82
+ main()
@@ -115,7 +115,7 @@ def display_glossary_terms(search_string: str, guid: str=None, server: str = goo
115
115
  print_exception_response(e)
116
116
  assert e.related_http_code != "200", "Invalid parameters"
117
117
 
118
- if __name__ == "__main__":
118
+ def main():
119
119
  sus_guid = "f9b78b26-6025-43fa-9299-a905cc6d1575"
120
120
  parser = argparse.ArgumentParser()
121
121
  parser.add_argument("--server", help="Name of the server to display status for")
@@ -132,4 +132,7 @@ if __name__ == "__main__":
132
132
  guid = sus_guid if args.sustainability else None
133
133
 
134
134
  search_string = Prompt.ask("Enter the term you are searching for:", default="*")
135
- display_glossary_terms(search_string, guid,server, url, userid)
135
+ display_glossary_terms(search_string, guid,server, url, userid)
136
+
137
+ if __name__ == "__main__":
138
+ main()
@@ -11,17 +11,13 @@ A simple display for glossary terms
11
11
  """
12
12
 
13
13
  import argparse
14
- import httpx
15
14
  import json
16
- import time
17
15
 
18
- from rich import box
19
16
  from rich import print
20
17
  from rich.console import Console
21
18
  from rich.prompt import Prompt
22
19
  from rich.text import Text
23
20
  from rich.tree import Tree
24
- from rich.json import JSON
25
21
 
26
22
  from pyegeria import (
27
23
  InvalidParameterException,
@@ -30,7 +26,6 @@ from pyegeria import (
30
26
  print_exception_response,
31
27
  Client
32
28
  )
33
- from pyegeria import ProjectManager
34
29
 
35
30
 
36
31
  def display_guid(guid: str, server: str, url: str, username: str):
@@ -67,7 +62,7 @@ def display_guid(guid: str, server: str, url: str, username: str):
67
62
  else:
68
63
  print_exception_response(e)
69
64
 
70
- if __name__ == "__main__":
65
+ def main():
71
66
 
72
67
  parser = argparse.ArgumentParser()
73
68
  parser.add_argument("--server", help="Name of the server to display status for")
@@ -83,4 +78,7 @@ if __name__ == "__main__":
83
78
 
84
79
  guid = Prompt.ask("Enter the GUID to retrieve:", default=None)
85
80
 
86
- display_guid(guid, server, url, userid)
81
+ display_guid(guid, server, url, userid)
82
+
83
+ if __name__ == "__main__":
84
+ main()
@@ -7,33 +7,19 @@ A simple viewer for collections - provide the root and we display the hierarchy
7
7
 
8
8
  """
9
9
 
10
- import time
11
10
  import argparse
12
11
 
13
- from rich.box import Box
14
- from rich.markdown import Markdown
12
+ from rich import print
13
+ from rich.panel import Panel
15
14
  from rich.prompt import Prompt
16
-
17
- from pyegeria._exceptions import (
18
- InvalidParameterException,
19
- PropertyServerException,
20
- UserNotAuthorizedException,
21
- print_exception_response,
22
- )
23
- from rich.table import Table
24
- from rich.live import Live
25
15
  from rich.text import Text
26
16
  from rich.tree import Tree
27
- from rich.markdown import Markdown
28
17
 
29
- from rich import print
30
- from rich.console import Group
31
- from rich.panel import Panel
32
- from rich import box, align
33
- from rich.layout import Layout
34
- import rich
35
- from pyegeria import (CollectionManager, UserNotAuthorizedException, PropertyServerException,
18
+ from pyegeria import (UserNotAuthorizedException, PropertyServerException,
36
19
  InvalidParameterException, AutomatedCuration)
20
+ from pyegeria._exceptions import (
21
+ print_exception_response,
22
+ )
37
23
 
38
24
  disable_ssl_warnings = True
39
25
 
@@ -95,7 +81,7 @@ def tech_viewer(tech: str, server_name:str, platform_url:str, user:str):
95
81
  print_exception_response(e)
96
82
 
97
83
 
98
- if __name__ == "__main__":
84
+ def main():
99
85
  parser = argparse.ArgumentParser()
100
86
 
101
87
  parser.add_argument("--server", help="Name of the server to display status for")
@@ -109,3 +95,6 @@ if __name__ == "__main__":
109
95
 
110
96
  tech = Prompt.ask("Enter the Technology to start from:", default="PostgreSQL Server")
111
97
  tech_viewer(tech,server, url, userid)
98
+
99
+ if __name__ == "__main__":
100
+ main()
@@ -74,7 +74,7 @@ def display_asset_types(server: str, url: str, username: str):
74
74
  r_client.close_session()
75
75
 
76
76
 
77
- if __name__ == "__main__":
77
+ def main():
78
78
  parser = argparse.ArgumentParser()
79
79
  parser.add_argument("--server", help="Name of the server to display status for")
80
80
  parser.add_argument("--url", help="URL Platform to connect to")
@@ -89,3 +89,6 @@ if __name__ == "__main__":
89
89
  guid = None
90
90
 
91
91
  display_asset_types(server, url, userid)
92
+
93
+ if __name__ == "__main__":
94
+ main()
@@ -116,7 +116,7 @@ def display_registered_svcs(service: str, server: str , url: str,
116
116
  a_client.close_session()
117
117
 
118
118
 
119
- if __name__ == "__main__":
119
+ def main():
120
120
  parser = argparse.ArgumentParser()
121
121
  parser.add_argument("--server", help="Name of the server to display status for")
122
122
  parser.add_argument("--url", help="URL Platform to connect to")
@@ -133,3 +133,6 @@ if __name__ == "__main__":
133
133
  svc_kind = Prompt.ask("Enter the service type you are searching for:", default="all")
134
134
 
135
135
  display_registered_svcs(svc_kind, server, url, userid, password=password)
136
+
137
+ if __name__ == "__main__":
138
+ main()