pyegeria 5.4.0.1__py3-none-any.whl → 5.4.0.3__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 (43) hide show
  1. commands/cat/__init__.py +1 -1
  2. commands/cat/dr_egeria_md.py +6 -4
  3. commands/cat/list_collections.py +47 -36
  4. md_processing/__init__.py +5 -2
  5. md_processing/data/commands-working.json +34850 -0
  6. md_processing/data/commands.json +1750 -530
  7. md_processing/md_commands/product_manager_commands.py +171 -220
  8. md_processing/md_processing_utils/common_md_proc_utils.py +9 -0
  9. md_processing/md_processing_utils/common_md_utils.py +15 -2
  10. md_processing/md_processing_utils/md_processing_constants.py +44 -6
  11. pyegeria/__init__.py +8 -4
  12. pyegeria/_client.py +2 -1
  13. pyegeria/_client_new.py +688 -0
  14. pyegeria/_exceptions_new.py +362 -0
  15. pyegeria/_globals.py +3 -1
  16. pyegeria/_output_formats.py +196 -0
  17. pyegeria/_validators.py +72 -199
  18. pyegeria/collection_manager_omvs.py +602 -324
  19. pyegeria/data_designer_omvs.py +251 -203
  20. pyegeria/load_config.py +217 -0
  21. pyegeria/logging_configuration.py +204 -0
  22. pyegeria/output_formatter.py +162 -31
  23. pyegeria/utils.py +99 -61
  24. {pyegeria-5.4.0.1.dist-info → pyegeria-5.4.0.3.dist-info}/METADATA +3 -1
  25. {pyegeria-5.4.0.1.dist-info → pyegeria-5.4.0.3.dist-info}/RECORD +28 -37
  26. commands/cat/debug_log +0 -2806
  27. commands/cat/debug_log.2025-07-15_14-28-38_087378.zip +0 -0
  28. commands/cat/debug_log.2025-07-16_15-48-50_037087.zip +0 -0
  29. md_processing/dr_egeria_outbox-pycharm/.obsidian/app.json +0 -1
  30. md_processing/dr_egeria_outbox-pycharm/.obsidian/appearance.json +0 -1
  31. md_processing/dr_egeria_outbox-pycharm/.obsidian/core-plugins.json +0 -31
  32. md_processing/dr_egeria_outbox-pycharm/.obsidian/workspace.json +0 -177
  33. md_processing/dr_egeria_outbox-pycharm/monday/processed-2025-07-14 12:38-data_designer_out.md +0 -663
  34. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 15:00-Derive-Dr-Gov-Defs.md +0 -719
  35. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:13-Derive-Dr-Gov-Defs.md +0 -41
  36. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:14-Derive-Dr-Gov-Defs.md +0 -33
  37. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:50-Derive-Dr-Gov-Defs.md +0 -192
  38. md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-16 19:15-gov_def2.md +0 -527
  39. md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-17 12:08-gov_def2.md +0 -527
  40. md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-17 14:27-gov_def2.md +0 -474
  41. {pyegeria-5.4.0.1.dist-info → pyegeria-5.4.0.3.dist-info}/LICENSE +0 -0
  42. {pyegeria-5.4.0.1.dist-info → pyegeria-5.4.0.3.dist-info}/WHEEL +0 -0
  43. {pyegeria-5.4.0.1.dist-info → pyegeria-5.4.0.3.dist-info}/entry_points.txt +0 -0
pyegeria/_validators.py CHANGED
@@ -10,6 +10,7 @@ from json import JSONDecodeError
10
10
  import validators
11
11
 
12
12
  from pyegeria._exceptions import InvalidParameterException, OMAGCommonErrorCode
13
+ from pyegeria._exceptions_new import PyegeriaInvalidParameterException
13
14
 
14
15
  """
15
16
  This package contains internally used validators.
@@ -27,41 +28,22 @@ def validate_user_id(user_id: str) -> bool:
27
28
 
28
29
  Returns
29
30
  -------
30
- bool: True if valid, If invalid an InvalidParameterException is raised.
31
+ bool: True if valid, If invalid input, a PyegeriaAuthenticationException is raised.
31
32
 
32
33
  Raises
33
34
  ------
34
- InvalidParameterException
35
+ PyegeriaAuthenticationException
35
36
  If the provided user id is null or empty
36
37
  """
37
38
  if (user_id is None) or len(user_id) == 0:
38
- msg = str(OMAGCommonErrorCode.NULL_USER_ID.value["message_template"]).format(
39
- "user_id"
40
- )
41
- calling_frame = inspect.currentframe().f_back
42
- caller_method = inspect.getframeinfo(calling_frame).function
43
-
44
- exc_msg = json.dumps(
45
- {
46
- "class": "VoidResponse",
47
- "relatedHTTPCode": 400,
48
- "exceptionClassName": "InvalidParameterException",
49
- "actionDescription": caller_method,
50
- "exceptionErrorMessage": msg,
51
- "exceptionErrorMessageId": OMAGCommonErrorCode.NULL_USER_ID.value[
52
- "message_id"
53
- ],
54
- "exceptionErrorMessageParameters": user_id,
55
- "exceptionSystemAction": OMAGCommonErrorCode.NULL_USER_ID.value[
56
- "system_action"
57
- ],
58
- "exceptionUserAction": OMAGCommonErrorCode.NULL_USER_ID.value[
59
- "user_action"
60
- ],
61
- "exceptionProperties": {"user_id": user_id},
39
+ context: dict = {}
40
+ context['calling_frame'] = inspect.currentframe().f_back
41
+ context['caller_method'] = inspect.currentframe().f_back.f_code.co_name
42
+ additional_info = {
43
+ "reason": "Invalid user name - its empty",
44
+ "userid": user_id,
62
45
  }
63
- )
64
- raise InvalidParameterException(exc_msg)
46
+ raise PyegeriaInvalidParameterException(None,context, additional_info)
65
47
  else:
66
48
  return True
67
49
 
@@ -78,35 +60,21 @@ def validate_server_name(server_name: str) -> bool:
78
60
  -------
79
61
  bool - True if valid, If invalid an InvalidParameterException is raised.
80
62
 
63
+ Raises
64
+ ------
65
+ PyegeriaInvalidParameterException
66
+ If the provided server name is null or empty
67
+
81
68
  """
82
- calling_frame = inspect.currentframe().f_back
83
- caller_method = inspect.getframeinfo(calling_frame).function
84
69
 
85
70
  if (server_name is None) or (len(server_name) == 0):
86
- msg = str(
87
- OMAGCommonErrorCode.SERVER_NAME_NOT_SPECIFIED.value["message_template"]
88
- )
89
- exc_msg = json.dumps(
90
- {
91
- "class": "VoidResponse",
92
- "relatedHTTPCode": 400,
93
- "exceptionClassName": "InvalidParameterException",
94
- "actionDescription": caller_method,
95
- "exceptionErrorMessage": msg,
96
- "exceptionErrorMessageId": OMAGCommonErrorCode.NULL_USER_ID.value[
97
- "message_id"
98
- ],
99
- "exceptionErrorMessageParameters": server_name,
100
- "exceptionSystemAction": OMAGCommonErrorCode.NULL_USER_ID.value[
101
- "system_action"
102
- ],
103
- "exceptionUserAction": OMAGCommonErrorCode.NULL_USER_ID.value[
104
- "user_action"
105
- ],
106
- "exceptionProperties": {"view_server": server_name},
71
+ context: dict = {}
72
+ context['calling_frame'] = inspect.currentframe().f_back
73
+ context['caller_method'] = inspect.currentframe().f_back.f_code.co_name
74
+ additional_info = {
75
+ "reason": "Invalid server name - its empty", "input_parameters": f"server_name={server_name}",
107
76
  }
108
- )
109
- raise InvalidParameterException(exc_msg)
77
+ raise PyegeriaInvalidParameterException(None, context, additional_info)
110
78
  else:
111
79
  return True
112
80
 
@@ -123,33 +91,19 @@ def validate_guid(guid: str) -> bool:
123
91
  -------
124
92
  bool - True if valid, If invalid an InvalidParameterException is raised.
125
93
 
94
+ Raises
95
+ ------
96
+ PyegeriaInvalidParameterException
97
+ If the provided guid is null or empty
126
98
  """
127
- calling_frame = inspect.currentframe().f_back
128
- caller_method = inspect.getframeinfo(calling_frame).function
129
-
130
99
  if (guid is None) or (len(guid) == 0) or (type(guid) is not str):
131
- msg = str(OMAGCommonErrorCode.NULL_GUID.value["message_template"])
132
- exc_msg = json.dumps(
133
- {
134
- "class": "VoidResponse",
135
- "relatedHTTPCode": 400,
136
- "exceptionClassName": "InvalidParameterException",
137
- "actionDescription": caller_method,
138
- "exceptionErrorMessage": msg,
139
- "exceptionErrorMessageId": OMAGCommonErrorCode.NULL_USER_ID.value[
140
- "message_id"
141
- ],
142
- "exceptionErrorMessageParameters": guid,
143
- "exceptionSystemAction": OMAGCommonErrorCode.NULL_USER_ID.value[
144
- "system_action"
145
- ],
146
- "exceptionUserAction": OMAGCommonErrorCode.NULL_USER_ID.value[
147
- "user_action"
148
- ],
149
- "exceptionProperties": {"guid": guid},
100
+ context: dict = {}
101
+ context['calling_frame'] = inspect.currentframe().f_back
102
+ context['caller_method'] = inspect.currentframe().f_back.f_code.co_name
103
+ additional_info = {
104
+ "reason": "Invalid GUID", "input_parameters": f"guid = {guid}"
150
105
  }
151
- )
152
- raise InvalidParameterException(exc_msg)
106
+ raise PyegeriaInvalidParameterException(None,context, additional_info)
153
107
  else:
154
108
  return True
155
109
 
@@ -166,33 +120,20 @@ def validate_name(name: str) -> bool:
166
120
  -------
167
121
  bool - True if valid, If invalid an InvalidParameterException is raised.
168
122
 
123
+ Raises
124
+ ------
125
+ PyegeriaInvalidParameterException
126
+ If the provided name is null or empty
169
127
  """
170
- calling_frame = inspect.currentframe().f_back
171
- caller_method = inspect.getframeinfo(calling_frame).function
172
128
 
173
129
  if (name is None) or (len(name) == 0):
174
- msg = str(OMAGCommonErrorCode.NULL_NAME.value["message_template"])
175
- exc_msg = json.dumps(
176
- {
177
- "class": "VoidResponse",
178
- "relatedHTTPCode": 400,
179
- "exceptionClassName": "InvalidParameterException",
180
- "actionDescription": caller_method,
181
- "exceptionErrorMessage": msg,
182
- "exceptionErrorMessageId": OMAGCommonErrorCode.NULL_USER_ID.value[
183
- "message_id"
184
- ],
185
- "exceptionErrorMessageParameters": name,
186
- "exceptionSystemAction": OMAGCommonErrorCode.NULL_USER_ID.value[
187
- "system_action"
188
- ],
189
- "exceptionUserAction": OMAGCommonErrorCode.NULL_USER_ID.value[
190
- "user_action"
191
- ],
192
- "exceptionProperties": {"name": name},
130
+ context: dict = {}
131
+ context['calling_frame'] = inspect.currentframe().f_back
132
+ context['caller_method'] = inspect.currentframe().f_back.f_code.co_name
133
+ additional_info = {
134
+ "reason": "Invalid `name`", "input_parameters": f"name = {name}"
193
135
  }
194
- )
195
- raise InvalidParameterException(exc_msg)
136
+ raise PyegeriaInvalidParameterException(None,context, additional_info)
196
137
  else:
197
138
  return True
198
139
 
@@ -209,37 +150,20 @@ def validate_search_string(search_string: str) -> bool:
209
150
  -------
210
151
  bool - True if valid, If invalid an InvalidParameterException is raised.
211
152
 
153
+ Raises
154
+ ------
155
+ PyegeriaInvalidParameterException
156
+ If the provided search string is null or empty
212
157
  """
213
- calling_frame = inspect.currentframe().f_back
214
- caller_method = inspect.getframeinfo(calling_frame).function
215
158
 
216
159
  if (search_string is None) or (len(search_string) == 0):
217
- msg = str(
218
- OMAGCommonErrorCode.NULL_SEARCH_STRING.value["message_template"].format(
219
- "search_string", caller_method
220
- )
221
- )
222
- exc_msg = json.dumps(
223
- {
224
- "class": "VoidResponse",
225
- "relatedHTTPCode": 400,
226
- "exceptionClassName": "InvalidParameterException",
227
- "actionDescription": caller_method,
228
- "exceptionErrorMessage": msg,
229
- "exceptionErrorMessageId": OMAGCommonErrorCode.NULL_USER_ID.value[
230
- "message_id"
231
- ],
232
- "exceptionErrorMessageParameters": [search_string, caller_method],
233
- "exceptionSystemAction": OMAGCommonErrorCode.NULL_USER_ID.value[
234
- "system_action"
235
- ],
236
- "exceptionUserAction": OMAGCommonErrorCode.NULL_USER_ID.value[
237
- "user_action"
238
- ],
239
- "exceptionProperties": {"search_string": search_string},
160
+ context: dict = {}
161
+ context['calling_frame'] = inspect.currentframe().f_back
162
+ context['caller_method'] = inspect.currentframe().f_back.f_code.co_name
163
+ additional_info = {
164
+ "reason": "Invalid `name`", "input_parameters": f"search_string={search_string}"
240
165
  }
241
- )
242
- raise InvalidParameterException(exc_msg)
166
+ raise PyegeriaInvalidParameterException(None,context, additional_info)
243
167
  else:
244
168
  return True
245
169
 
@@ -256,33 +180,20 @@ def validate_public(is_public: bool) -> bool:
256
180
  -------
257
181
  bool - True if valid, If invalid an InvalidParameterException is raised.
258
182
 
183
+ Raises
184
+ ------
185
+ PyegeriaInvalidParameterException
186
+ If the provided public flag is null or empty
259
187
  """
260
- calling_frame = inspect.currentframe().f_back
261
- caller_method = inspect.getframeinfo(calling_frame).function
262
188
 
263
189
  if is_public is None:
264
- msg = str(OMAGCommonErrorCode.NULL_OBJECT.value["message_template"])
265
- exc_msg = json.dumps(
266
- {
267
- "class": "VoidResponse",
268
- "relatedHTTPCode": 400,
269
- "exceptionClassName": "InvalidParameterException",
270
- "actionDescription": caller_method,
271
- "exceptionErrorMessage": msg,
272
- "exceptionErrorMessageId": OMAGCommonErrorCode.NULL_USER_ID.value[
273
- "message_id"
274
- ],
275
- "exceptionErrorMessageParameters": is_public,
276
- "exceptionSystemAction": OMAGCommonErrorCode.NULL_USER_ID.value[
277
- "system_action"
278
- ],
279
- "exceptionUserAction": OMAGCommonErrorCode.NULL_USER_ID.value[
280
- "user_action"
281
- ],
282
- "exceptionProperties": {"is_public": is_public},
190
+ context: dict = {}
191
+ context['calling_frame'] = inspect.currentframe().f_back
192
+ context['caller_method'] = inspect.currentframe().f_back.f_code.co_name
193
+ additional_info = {
194
+ "reason": "Invalid `name`", "input_parameters": f"is_public={is_public}"
283
195
  }
284
- )
285
- raise InvalidParameterException(exc_msg)
196
+ raise PyegeriaInvalidParameterException(None,context, additional_info)
286
197
  else:
287
198
  return True
288
199
 
@@ -301,34 +212,15 @@ def validate_url(url: str) -> bool:
301
212
  bool - True if valid, If invalid an InvalidParameterException is raised.
302
213
 
303
214
  """
304
- calling_frame = inspect.currentframe().f_back
305
- caller_method = inspect.getframeinfo(calling_frame).function
215
+ context: dict = {}
216
+ context['calling_frame'] = inspect.currentframe().f_back
217
+ context['caller_method'] = inspect.currentframe().f_back.f_code.co_name
306
218
 
307
219
  if (url is None) or (len(url) == 0):
308
- msg = str(
309
- OMAGCommonErrorCode.SERVER_URL_NOT_SPECIFIED.value["message_template"]
310
- )
311
- exc_msg = json.dumps(
312
- {
313
- "class": "VoidResponse",
314
- "relatedHTTPCode": 400,
315
- "exceptionClassName": "InvalidParameterException",
316
- "actionDescription": caller_method,
317
- "exceptionErrorMessage": msg,
318
- "exceptionErrorMessageId": OMAGCommonErrorCode.SERVER_URL_MALFORMED.value[
319
- "message_id"
320
- ],
321
- "exceptionErrorMessageParameters": url,
322
- "exceptionSystemAction": OMAGCommonErrorCode.SERVER_URL_MALFORMED.value[
323
- "system_action"
324
- ],
325
- "exceptionUserAction": OMAGCommonErrorCode.SERVER_URL_MALFORMED.value[
326
- "user_action"
327
- ],
328
- "exceptionProperties": {"url": url},
329
- }
330
- )
331
- raise InvalidParameterException(exc_msg)
220
+
221
+ additional_info = {"reason": "The provided URL is invalid - it is empty",
222
+ "input_parameters": f"URL: {url}"}
223
+ raise PyegeriaInvalidParameterException(None,context, additional_info)
332
224
 
333
225
  # The following hack allows localhost to be used as a hostname - which is disallowed by the
334
226
  # validations package
@@ -337,30 +229,11 @@ def validate_url(url: str) -> bool:
337
229
 
338
230
  result = validators.url(url)
339
231
  if result is not True:
340
- msg = OMAGCommonErrorCode.SERVER_URL_MALFORMED.value["message_template"].format(
341
- url
342
- )
343
- exc_msg = json.dumps(
344
- {
345
- "class": "VoidResponse",
346
- "relatedHTTPCode": 400,
347
- "exceptionClassName": "InvalidParameterException",
348
- "actionDescription": caller_method,
349
- "exceptionErrorMessage": msg,
350
- "exceptionErrorMessageId": OMAGCommonErrorCode.SERVER_URL_MALFORMED.value[
351
- "message_id"
352
- ],
353
- "exceptionErrorMessageParameters": url,
354
- "exceptionSystemAction": OMAGCommonErrorCode.SERVER_URL_MALFORMED.value[
355
- "system_action"
356
- ],
357
- "exceptionUserAction": OMAGCommonErrorCode.SERVER_URL_MALFORMED.value[
358
- "user_action"
359
- ],
360
- "exceptionProperties": {"url": url},
232
+ additional_info = {
233
+ "reason": "The provided URL is invalid",
234
+ "input_parameters": f"URL: {url}"
361
235
  }
362
- )
363
- raise InvalidParameterException(exc_msg)
236
+ raise PyegeriaInvalidParameterException(None,context, additional_info)
364
237
  else:
365
238
  return True
366
239