pyegeria 0.3.8__py3-none-any.whl → 0.3.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.
Files changed (50) hide show
  1. pyegeria/Xasset_catalog_omvs.py +539 -0
  2. pyegeria/Xfeedback_manager_omvs.py +251 -0
  3. pyegeria/Xglossary_manager_omvs.py +3001 -0
  4. pyegeria/Xloaded_resources_omvs.py +91 -0
  5. pyegeria/__init__.py +6 -10
  6. pyegeria/_client.py +4 -6
  7. pyegeria/{gov_engine.py → _deprecated_gov_engine.py} +2 -59
  8. pyegeria/_exceptions.py +5 -6
  9. pyegeria/_globals.py +1 -1
  10. pyegeria/automated_curation_omvs.py +320 -315
  11. pyegeria/collection_manager_omvs.py +187 -248
  12. pyegeria/core_omag_server_config.py +1 -5
  13. pyegeria/full_omag_server_config.py +53 -83
  14. pyegeria/glossary_browser_omvs.py +2208 -0
  15. pyegeria/my_profile_omvs.py +2 -7
  16. pyegeria/platform_services.py +0 -3
  17. pyegeria/project_manager_omvs.py +9 -15
  18. pyegeria/registered_info.py +12 -52
  19. pyegeria/server_operations.py +1 -5
  20. pyegeria/valid_metadata_omvs.py +11 -23
  21. pyegeria-0.3.9.data/scripts/Create_Collection_Sample.py +292 -0
  22. pyegeria-0.3.9.data/scripts/Create_Sustainability_Collection_Sample.py +115 -0
  23. pyegeria-0.3.9.data/scripts/coco_status.py +98 -0
  24. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/collection_viewer.py +12 -31
  25. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/engine_action_status.py +9 -28
  26. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/find_todos.py +9 -38
  27. pyegeria-0.3.9.data/scripts/get_registered_services.py +135 -0
  28. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/get_relationship_types.py +16 -35
  29. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/glossary_view.py +2 -2
  30. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/gov_engine_status.py +0 -1
  31. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/list_asset_types.py +3 -25
  32. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/my_todos.py +1 -1
  33. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/open_todos.py +3 -24
  34. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/project_list_viewer.py +12 -26
  35. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/server_status.py +1 -20
  36. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/view_my_profile.py +8 -34
  37. {pyegeria-0.3.8.dist-info → pyegeria-0.3.9.dist-info}/METADATA +1 -3
  38. pyegeria-0.3.9.dist-info/RECORD +49 -0
  39. pyegeria/glossary_omvs.py +0 -789
  40. pyegeria/loaded_resources_omvs.py +0 -159
  41. pyegeria-0.3.8.dist-info/RECORD +0 -42
  42. /pyegeria/{governance_author.py → Xaction_author_omvs.py} +0 -0
  43. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/get_tech_details.py +0 -0
  44. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/get_tech_types.py +0 -0
  45. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/integration_daemon_status.py +0 -0
  46. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/multi-server_status.py +0 -0
  47. {pyegeria-0.3.8.data → pyegeria-0.3.9.data}/scripts/server_status_widget.py +0 -0
  48. {pyegeria-0.3.8.dist-info → pyegeria-0.3.9.dist-info}/LICENSE +0 -0
  49. {pyegeria-0.3.8.dist-info → pyegeria-0.3.9.dist-info}/WHEEL +0 -0
  50. {pyegeria-0.3.8.dist-info → pyegeria-0.3.9.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,91 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+
6
+
7
+ This module allows users to query the available (registered) capabilities of Egeria. Detailed information is returned
8
+ to provide both insight and understanding in how to use these capabilities. For example, when configuring an Egeria
9
+ integration service, it is importregistered_info.pyant to know what companion service it depends on so that you can make sure the
10
+ companion service is also configured and running.
11
+
12
+ """
13
+
14
+ from pyegeria import (
15
+ Client, max_paging_size, InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
16
+ print_exception_response
17
+ )
18
+
19
+
20
+
21
+ class LoadedResources(Client):
22
+ """ Client to search and retrieve currently loaded information about connectors, templates, governance actions,
23
+ etc.
24
+
25
+ Attributes:
26
+ ----------
27
+ server_name: str
28
+ Name of the server to use.
29
+ platform_url : str
30
+ URL of the server platform to connect to
31
+ user_id : str
32
+ The identity of the user calling the method - this sets a default optionally used by the methods
33
+ when the user doesn't pass the user_id on a method call.
34
+ user_pwd: str
35
+ The password associated with the user_id. Defaults to None
36
+ verify_flag: bool
37
+ Flag to indicate if SSL Certificates should be verified in the HTTP requests.
38
+ Defaults to False.
39
+
40
+ Methods:
41
+ -------
42
+
43
+ """
44
+
45
+ admin_command_root: str
46
+
47
+ def __init__(
48
+ self,
49
+ server_name: str,
50
+ platform_url: str,
51
+ user_id: str,
52
+ user_pwd: str = None,
53
+ verify_flag: bool = False,
54
+ ):
55
+ if server_name is None:
56
+ server_name = "NA"
57
+ Client.__init__(self, server_name, platform_url,
58
+ user_id, user_pwd, verify_flag)
59
+
60
+ def get_all_templates(self, server: str = None, start_from: int = 0, page_size: int = 0) -> list | str:
61
+ """ Get Loaded templates for the Server.
62
+
63
+ Parameters
64
+ ----------
65
+
66
+ Returns
67
+ -------
68
+ dict | str
69
+ A dictionary containing a simplified list of key template attributes.
70
+
71
+ Raises
72
+ ------
73
+ InvalidParameterException
74
+ If the response code is not 200.
75
+ PropertyServerException:
76
+ Raised by the server when an issue arises in processing a valid request
77
+ NotAuthorizedException:
78
+ The principle specified by the user_id does not have authorization for the requested action
79
+
80
+ """
81
+ server = self.server_name if server is None else server
82
+ url = (f"{self.platform_url}/servers/{server}/open-metadata/framework-services/asset-owner/open-metadata-store/"
83
+ f"users/{self.user_id}/metadata-elements/by-search-string?startFrom=start_from&pageSize=page_size")
84
+ body = {
85
+ "class" : "SearchStringRequestBody",
86
+ "searchString" : ".*Template.*"
87
+ }
88
+ response = self.make_request("POST", url, body)
89
+ return response.json().get("elementList", "No elements")
90
+
91
+ # def get_all_assets_in_archives(self, asset_type: str = None, archive_id: str = None, server: str= None, page_start:int = 0, page_size = max_paging_size):
pyegeria/__init__.py CHANGED
@@ -11,12 +11,6 @@ the server platform and servers.
11
11
 
12
12
  """
13
13
 
14
-
15
- try:
16
- import tomllib
17
- except ModuleNotFoundError:
18
- import tomli as tomllib
19
-
20
14
  from ._globals import is_debug, disable_ssl_warnings, max_paging_size
21
15
 
22
16
  if disable_ssl_warnings:
@@ -32,16 +26,18 @@ from .automated_curation_omvs import AutomatedCuration
32
26
  from .core_omag_server_config import CoreServerConfig
33
27
  from .platform_services import Platform
34
28
  from .registered_info import RegisteredInfo
35
- from .glossary_omvs import GlossaryBrowser
29
+ from .glossary_browser_omvs import GlossaryBrowser
36
30
  from ._validators import (validate_user_id, validate_name, validate_guid, validate_server_name, validate_search_string,
37
31
  validate_url, is_json, validate_public)
38
32
  # from .asset_catalog_omvs import AssetCatalog
39
- from .gov_engine import GovEng
33
+
40
34
  from .my_profile_omvs import MyProfile
41
35
  from .full_omag_server_config import FullServerConfig
42
36
  from .server_operations import ServerOps
43
37
  from .collection_manager_omvs import CollectionManager
44
38
  from .project_manager_omvs import ProjectManager
45
39
  from .valid_metadata_omvs import ValidMetadataManager
46
- from .loaded_resources_omvs import LoadedResources
47
- __version__ = "0.38"
40
+ from .Xasset_catalog_omvs import AssetCatalog
41
+ from .Xloaded_resources_omvs import LoadedResources
42
+ from ._deprecated_gov_engine import GovEng
43
+ __version__ = "0.3.9"
pyegeria/_client.py CHANGED
@@ -12,6 +12,7 @@ import json
12
12
  import os
13
13
 
14
14
  import httpx
15
+ from httpx import AsyncClient, Response
15
16
 
16
17
  from pyegeria._exceptions import (
17
18
  OMAGCommonErrorCode,
@@ -126,9 +127,6 @@ class Client:
126
127
  self.headers["Authorization"] = f"Bearer {token}"
127
128
  self.text_headers["Authorization"] = f"Bearer {token}"
128
129
 
129
- calling_frame = inspect.currentframe().f_back
130
- caller_method = inspect.getframeinfo(calling_frame).function
131
-
132
130
  v_url = validate_url(platform_url)
133
131
 
134
132
  if v_url:
@@ -139,7 +137,7 @@ class Client:
139
137
  # self.session = httpx.Client(verify=self.ssl_verify)
140
138
  # else:
141
139
  # self.session = httpx.AsyncClient(verify=self.ssl_verify)
142
- self.session = httpx.AsyncClient(verify=self.ssl_verify)
140
+ self.session = AsyncClient(verify=self.ssl_verify)
143
141
 
144
142
  def __enter__(self):
145
143
  return self
@@ -334,7 +332,7 @@ class Client:
334
332
  return self.text_headers["Authorization"]
335
333
 
336
334
  def make_request(self, request_type: str, endpoint: str, payload: str | dict = None,
337
- time_out: int = 30) -> dict | str:
335
+ time_out: int = 30) -> Response | str:
338
336
  """ Make a request to the Egeria API"""
339
337
  loop = asyncio.get_event_loop()
340
338
  response = loop.run_until_complete(self._async_make_request(request_type, endpoint,
@@ -342,7 +340,7 @@ class Client:
342
340
  return response
343
341
 
344
342
  async def _async_make_request(self, request_type: str, endpoint: str, payload: str | dict = None,
345
- time_out: int = 30) -> dict | str:
343
+ time_out: int = 30) -> Response | str:
346
344
  """ Make a request to the Egeria API - Async Version
347
345
  Function to make an API call via the self.session Library. Raise an exception if the HTTP response code
348
346
  is not 200/201. IF there is a REST communication exception, raise InvalidParameterException.
@@ -3,6 +3,8 @@ SPDX-License-Identifier: Apache-2.0
3
3
  Copyright Contributors to the ODPi Egeria project.
4
4
 
5
5
  Governance Engine functions. These functions initiate and manage Governance Actions and Processes
6
+
7
+ This module is deprecated - please use Automated Curation.
6
8
  """
7
9
 
8
10
  from datetime import datetime
@@ -396,62 +398,3 @@ class GovEng(Client):
396
398
  response = self.make_request("POST", url, new_body)
397
399
  return response.json().get('guid')
398
400
 
399
- def print_engine_action_summary(self, governance_action: dict):
400
- """ print_governance_action_summary
401
-
402
- Print all the governance actions with their status, in the server.
403
-
404
- Parameters
405
- ----------
406
-
407
- Returns
408
- -------
409
-
410
- Raises
411
- ------
412
- InvalidParameterException
413
- PropertyServerException
414
- UserNotAuthorizedException
415
- """
416
- if governance_action:
417
- name = governance_action.get('displayName')
418
- if not name:
419
- name = governance_action.get('qualifiedName')
420
- action_status = governance_action.get('action_status')
421
- if governance_action.get('completion_guards'):
422
- completion_guards = governance_action.get('completion_guards')
423
- else:
424
- completion_guards = "\t"
425
- if governance_action.get('process_name'):
426
- process_name = governance_action.get('process_name')
427
- else:
428
- process_name = "\t"
429
- if governance_action.get('completion_message'):
430
- completion_message = governance_action.get('completion_message')
431
- else:
432
- completion_message = ""
433
- print(action_status + "\n\t| " + name + "\t| " + process_name + "\t| " + '%s' % ', '.join(
434
- map(str, completion_guards)) + "\t| " + completion_message)
435
-
436
- def print_engine_actions(self):
437
- """ print_governance_actions
438
-
439
- Print all the governance actions with their status, in the server.
440
-
441
- Parameters
442
- ----------
443
-
444
- Returns
445
- -------
446
-
447
- Raises
448
- ------
449
- InvalidParameterException
450
- PropertyServerException
451
- UserNotAuthorizedException
452
-
453
- """
454
- governance_actions = self.get_engine_actions(0, 0)
455
- if governance_actions is not None:
456
- for x in range(len(governance_actions)):
457
- self.print_engine_action_summary(governance_actions[x])
pyegeria/_exceptions.py CHANGED
@@ -323,6 +323,7 @@ class EgeriaException(Exception):
323
323
 
324
324
  """
325
325
  raw_error_message = ""
326
+
326
327
  def __init__(self, response_body) -> None:
327
328
  response_dict = json.loads(response_body)
328
329
  self.response_class = response_dict["class"]
@@ -330,14 +331,12 @@ class EgeriaException(Exception):
330
331
  self.exception_class_name = response_dict["exceptionClassName"]
331
332
  self.action_description = response_dict["actionDescription"]
332
333
  self.exception_error_message = response_dict["exceptionErrorMessage"]
333
- self.exception_error_message_id = response_dict["exceptionErrorMessageId"]
334
+ self.exception_error_message_id = response_dict.get("exceptionErrorMessageId", "UNKNOWN-ERROR-CODE")
334
335
 
335
336
  # self.exception_error_message_id = response_dict["exceptionErrorMessageId"]
336
- self.exception_error_message_parameters = response_dict[
337
- "exceptionErrorMessageParameters"
338
- ]
339
- self.exception_system_action = response_dict["exceptionSystemAction"]
340
- self.exception_user_action = response_dict["exceptionUserAction"]
337
+ self.exception_error_message_parameters = response_dict.get("exceptionErrorMessageParameters", "{}")
338
+ self.exception_system_action = response_dict.get("exceptionSystemAction", "UNKNOWN-SYSTEM-ACTION")
339
+ self.exception_user_action = response_dict.get("exceptionUserAction", "UNKNOWN-USER-ACTION")
341
340
 
342
341
  def __str__(self):
343
342
  return self.exception_error_message
pyegeria/_globals.py CHANGED
@@ -11,7 +11,7 @@ This common file is used to set some global values and enumerations used by the
11
11
  is_debug = False
12
12
  disable_ssl_warnings = True
13
13
  enable_ssl_check = False
14
- max_paging_size = 100
14
+ max_paging_size = 5000
15
15
 
16
16
  comment_types = (
17
17
  "ANSWER",