pyegeria 0.7.25__py3-none-any.whl → 0.7.27__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.
@@ -128,7 +128,7 @@ def change_todo_status(server, url, userid, password, timeout, todo_guid, new_st
128
128
 
129
129
  m_client.update_to_do(todo_guid, body, is_merge_update=True)
130
130
 
131
- click.echo(f"Marked todo item {todo_guid} as complete.")
131
+ click.echo(f"Changed todo item {todo_guid} status to {new_status}.")
132
132
 
133
133
  except (InvalidParameterException, PropertyServerException) as e:
134
134
  print_exception_response(e)
@@ -145,8 +145,8 @@ def change_todo_status(server, url, userid, password, timeout, todo_guid, new_st
145
145
  @click.argument('todo-guid')
146
146
  def mark_todo_complete(server, url, userid, password, timeout, todo_guid):
147
147
  """Mark the specified todo as complete"""
148
+ m_client = MyProfile(server, url, user_id=userid, user_pwd=password)
148
149
  try:
149
- m_client = MyProfile(server, url, user_id=userid, user_pwd=password)
150
150
  token = m_client.create_egeria_bearer_token()
151
151
  body = {
152
152
  "class": "ToDoProperties",
pyegeria/__init__.py CHANGED
@@ -11,9 +11,14 @@ the server platform and servers.
11
11
 
12
12
  """
13
13
 
14
- from ._globals import (is_debug, disable_ssl_warnings, max_paging_size, TEMPLATE_GUIDS, INTEGRATION_GUIDS,
15
- default_time_out
16
- )
14
+ from ._globals import (
15
+ is_debug,
16
+ disable_ssl_warnings,
17
+ max_paging_size,
18
+ TEMPLATE_GUIDS,
19
+ INTEGRATION_GUIDS,
20
+ default_time_out,
21
+ )
17
22
 
18
23
  if disable_ssl_warnings:
19
24
  from urllib3.exceptions import InsecureRequestWarning
@@ -21,8 +26,13 @@ if disable_ssl_warnings:
21
26
 
22
27
  disable_warnings(InsecureRequestWarning)
23
28
 
24
- from ._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
25
- print_exception_response)
29
+ from ._exceptions import (
30
+ InvalidParameterException,
31
+ PropertyServerException,
32
+ UserNotAuthorizedException,
33
+ print_exception_response,
34
+ )
35
+
26
36
  # from .utils import print_response, body_slimmer, wrap_text
27
37
  from .utils import print_response, body_slimmer
28
38
  from ._client import Client
@@ -31,8 +41,16 @@ from .core_omag_server_config import CoreServerConfig
31
41
  from .platform_services import Platform
32
42
  from .registered_info import RegisteredInfo
33
43
  from .glossary_browser_omvs import GlossaryBrowser
34
- from ._validators import (validate_user_id, validate_name, validate_guid, validate_server_name, validate_search_string,
35
- validate_url, is_json, validate_public)
44
+ from ._validators import (
45
+ validate_user_id,
46
+ validate_name,
47
+ validate_guid,
48
+ validate_server_name,
49
+ validate_search_string,
50
+ validate_url,
51
+ is_json,
52
+ validate_public,
53
+ )
36
54
  from .asset_catalog_omvs import AssetCatalog
37
55
 
38
56
  from .my_profile_omvs import MyProfile
@@ -50,6 +68,7 @@ from .glossary_manager_omvs import GlossaryManager
50
68
  from .create_tech_guid_lists import build_global_guid_lists
51
69
  from .classification_manager_omvs import ClassificationManager
52
70
  from .feedback_manager_omvs import FeedbackManager
71
+ from .mermaid_utilities import load_mermaid, render_mermaid, generate_process_graph
53
72
 
54
73
 
55
74
  #
@@ -64,65 +83,73 @@ from .feedback_manager_omvs import FeedbackManager
64
83
  #
65
84
  global TEMPLATE_GUIDS, INTEGRATION_GUIDS
66
85
 
67
- TEMPLATE_GUIDS['CSV Data File'] = '13770f93-13c8-42be-9bb8-e0b1b1e52b1f'
68
- TEMPLATE_GUIDS['Keystore File'] = 'fbcfcc0c-1652-421f-b49b-c3e1c108768f'
69
- TEMPLATE_GUIDS['Unity Catalog Server'] = 'dcca9788-b30f-4007-b1ac-ec634aff6879'
70
- INTEGRATION_GUIDS['UnityCatalogInsideCatalog'] = '74dde22f-2249-4ea3-af2b-b39e73f79b81'
71
- INTEGRATION_GUIDS['UnityCatalogServer'] = '06d068d9-9e08-4e67-8c59-073bbf1013af'
72
- INTEGRATION_GUIDS['JDBC'] = '70dcd0b7-9f06-48ad-ad44-ae4d7a7762aa'
73
- TEMPLATE_GUIDS['Data File'] = '66d8dda9-00cf-4e59-938c-4b0583596b1e'
74
- TEMPLATE_GUIDS['View Server'] = 'fd61ca01-390d-4aa2-a55d-426826aa4e1b'
75
- TEMPLATE_GUIDS['Archive File'] = '7578e504-d00f-406d-a194-3fc0a351cdf9'
76
- TEMPLATE_GUIDS['Unity Catalog Catalog'] = '5ee006aa-a6d6-411b-9b8d-5f720c079cae'
77
- TEMPLATE_GUIDS['PostgreSQL Relational Database'] = '3d398b3f-7ae6-4713-952a-409f3dea8520'
78
- INTEGRATION_GUIDS['JDBC'] = '70dcd0b7-9f06-48ad-ad44-ae4d7a7762aa'
79
- TEMPLATE_GUIDS['Program File'] = '32d27e9c-1fdf-455a-ad2a-42b4d7d99108'
80
- TEMPLATE_GUIDS['FileFolder'] = 'fbdd8efd-1b69-474c-bb6d-0a304b394146'
81
- INTEGRATION_GUIDS['LandingAreaFilesMonitor'] = '1b98cdac-dd0a-4621-93db-99ef5a1098bc'
82
- INTEGRATION_GUIDS['SampleDataFilesMonitor'] = 'cd6479e1-2fe7-4426-b358-8a0cf70be117'
83
- TEMPLATE_GUIDS['PostgreSQL Server'] = '542134e6-b9ce-4dce-8aef-22e8daf34fdb'
84
- INTEGRATION_GUIDS['PostgreSQLServer'] = '36f69fd0-54ba-4f59-8a44-11ccf2687a34'
85
- TEMPLATE_GUIDS['Audio Data File'] = '39b4b670-7f15-4744-a5ba-62e8edafbcee'
86
- TEMPLATE_GUIDS['Document File'] = 'eb6f728d-fa54-4350-9807-1199cbf96851'
87
- TEMPLATE_GUIDS['Integration Daemon'] = '6b3516f0-dd13-4786-9601-07215f995197'
88
- TEMPLATE_GUIDS['XML Data File'] = 'ea67ae71-c674-473e-b38b-689879d2a7d9'
89
- TEMPLATE_GUIDS['Unity Catalog Schema'] = '5bf92b0f-3970-41ea-b0a3-aacfbf6fd92e'
90
- TEMPLATE_GUIDS['Parquet Data File'] = '7f6cd744-79c3-4d25-a056-eeb1a91574c3'
91
- TEMPLATE_GUIDS['3D Image Data File'] = '0059ea2b-6292-4cac-aa6f-a80a605f1114'
92
- TEMPLATE_GUIDS['YAML File'] = '2221855b-2b64-4b45-a2ee-c40adc5e2a64'
93
- TEMPLATE_GUIDS['Metadata Access Server'] = 'bd8de890-fa79-4c24-aab8-20b41b5893dd'
94
- TEMPLATE_GUIDS['Properties File'] = '3b281111-a0ef-4fc4-99e7-9a0ef84a7636'
95
- TEMPLATE_GUIDS['Vector Data File'] = 'db1bec7f-55a9-40d3-91c0-a57b76d422e2'
96
- TEMPLATE_GUIDS['Apache Kafka Server'] = '5e1ff810-5418-43f7-b7c4-e6e062f9aff7'
97
- INTEGRATION_GUIDS['KafkaTopic'] = 'fa1f711c-0b34-4b57-8e6e-16162b132b0c'
98
- TEMPLATE_GUIDS['Executable File'] = '3d99a163-7a13-4576-a212-784010a8302a'
99
- TEMPLATE_GUIDS['Unity Catalog Table'] = '6cc1e5f5-4c1e-4290-a80e-e06643ffb13d'
100
- TEMPLATE_GUIDS['JSON Data File'] = 'c4836635-7e9e-446a-83b5-15e206b1aff3'
101
- TEMPLATE_GUIDS['File System'] = '522f228c-097c-4f90-9efc-26c1f2696f87'
102
- TEMPLATE_GUIDS['Source Code File'] = '9c7013ef-f29b-4b01-a8ea-5ea14f64c67a'
103
- TEMPLATE_GUIDS['Apple MacBook Pro'] = '32a9fd56-85c9-47fe-a211-9da3871bf4da'
104
- TEMPLATE_GUIDS['Build Instruction File'] = 'fbb2fa2e-8bcb-402e-9be7-5c6db9f2c504'
105
- TEMPLATE_GUIDS['Spreadsheet Data File'] = 'e4fabff5-2ba9-4050-9076-6ed917970b4c'
106
- TEMPLATE_GUIDS['UNIX File System'] = '27117270-8667-41d0-a99a-9118f9b60199'
107
- TEMPLATE_GUIDS['Video Data File'] = '93b2b722-ec0f-4da4-960a-b8d4922f8bf5'
108
- TEMPLATE_GUIDS['Unity Catalog Function'] = 'a490ba65-6104-4213-9be9-524e16fed8aa'
109
- TEMPLATE_GUIDS['PostgreSQL Relational Database Schema'] = '82a5417c-d882-4271-8444-4c6a996a8bfc'
110
- TEMPLATE_GUIDS['Engine Host'] = '1764a891-4234-45f1-8cc3-536af40c790d'
111
- TEMPLATE_GUIDS['Avro Data File'] = '9f5be428-058e-41dd-b506-3a222283b579'
112
- TEMPLATE_GUIDS['Unity Catalog Volume'] = '92d2d2dc-0798-41f0-9512-b10548d312b7'
113
- TEMPLATE_GUIDS['File'] = 'ae3067c7-cc72-4a18-88e1-746803c2c86f'
114
- TEMPLATE_GUIDS['Apache Kafka Topic'] = 'ea8f81c9-c59c-47de-9525-7cc59d1251e5'
115
- TEMPLATE_GUIDS['Script File'] = 'dbd5e6bb-1ff8-46f4-a007-fb0485f68c92'
116
- TEMPLATE_GUIDS['Apache Atlas Server'] = 'fe6dce45-a978-4417-ab55-17f05b8bcea7'
117
- TEMPLATE_GUIDS['Raster Data File'] = '47211156-f03f-4881-8526-015e695a3dac'
118
- TEMPLATE_GUIDS['Data Folder'] = '372a0379-7060-4c9d-8d84-bc709b31794c'
119
- TEMPLATE_GUIDS['OMAG Server Platform'] = '9b06c4dc-ddc8-47ae-b56b-28775d3a96f0'
120
- INTEGRATION_GUIDS['OpenAPI'] = 'b89d9a5a-2ea6-49bc-a4fc-e7df9f3ca93e'
121
- INTEGRATION_GUIDS['PostgreSQLServerCataloguer'] = '36f69fd0-54ba-4f59-8a44-11ccf2687a34'
122
- INTEGRATION_GUIDS['UnityCatalogInsideCatalogSynchronizer'] = '74dde22f-2249-4ea3-af2b-b39e73f79b81'
123
- INTEGRATION_GUIDS['JDBCDatabaseCataloguer'] = '70dcd0b7-9f06-48ad-ad44-ae4d7a7762aa'
124
- INTEGRATION_GUIDS['SampleDataCataloguer'] = 'cd6479e1-2fe7-4426-b358-8a0cf70be117'
125
- INTEGRATION_GUIDS['OpenAPICataloguer'] = 'b89d9a5a-2ea6-49bc-a4fc-e7df9f3ca93e'
126
- INTEGRATION_GUIDS['ApacheKafkaCataloguer'] = 'fa1f711c-0b34-4b57-8e6e-16162b132b0c'
127
- INTEGRATION_GUIDS['UnityCatalogServerSynchronizer'] = '06d068d9-9e08-4e67-8c59-073bbf1013af'
128
- INTEGRATION_GUIDS['LandingAreaCataloguer'] = '1b98cdac-dd0a-4621-93db-99ef5a1098bc'
86
+ TEMPLATE_GUIDS["CSV Data File"] = "13770f93-13c8-42be-9bb8-e0b1b1e52b1f"
87
+ TEMPLATE_GUIDS["Keystore File"] = "fbcfcc0c-1652-421f-b49b-c3e1c108768f"
88
+ TEMPLATE_GUIDS["Unity Catalog Server"] = "dcca9788-b30f-4007-b1ac-ec634aff6879"
89
+ INTEGRATION_GUIDS["UnityCatalogInsideCatalog"] = "74dde22f-2249-4ea3-af2b-b39e73f79b81"
90
+ INTEGRATION_GUIDS["UnityCatalogServer"] = "06d068d9-9e08-4e67-8c59-073bbf1013af"
91
+ INTEGRATION_GUIDS["JDBC"] = "70dcd0b7-9f06-48ad-ad44-ae4d7a7762aa"
92
+ TEMPLATE_GUIDS["Data File"] = "66d8dda9-00cf-4e59-938c-4b0583596b1e"
93
+ TEMPLATE_GUIDS["View Server"] = "fd61ca01-390d-4aa2-a55d-426826aa4e1b"
94
+ TEMPLATE_GUIDS["Archive File"] = "7578e504-d00f-406d-a194-3fc0a351cdf9"
95
+ TEMPLATE_GUIDS["Unity Catalog Catalog"] = "5ee006aa-a6d6-411b-9b8d-5f720c079cae"
96
+ TEMPLATE_GUIDS[
97
+ "PostgreSQL Relational Database"
98
+ ] = "3d398b3f-7ae6-4713-952a-409f3dea8520"
99
+ INTEGRATION_GUIDS["JDBC"] = "70dcd0b7-9f06-48ad-ad44-ae4d7a7762aa"
100
+ TEMPLATE_GUIDS["Program File"] = "32d27e9c-1fdf-455a-ad2a-42b4d7d99108"
101
+ TEMPLATE_GUIDS["FileFolder"] = "fbdd8efd-1b69-474c-bb6d-0a304b394146"
102
+ INTEGRATION_GUIDS["LandingAreaFilesMonitor"] = "1b98cdac-dd0a-4621-93db-99ef5a1098bc"
103
+ INTEGRATION_GUIDS["SampleDataFilesMonitor"] = "cd6479e1-2fe7-4426-b358-8a0cf70be117"
104
+ TEMPLATE_GUIDS["PostgreSQL Server"] = "542134e6-b9ce-4dce-8aef-22e8daf34fdb"
105
+ INTEGRATION_GUIDS["PostgreSQLServer"] = "36f69fd0-54ba-4f59-8a44-11ccf2687a34"
106
+ TEMPLATE_GUIDS["Audio Data File"] = "39b4b670-7f15-4744-a5ba-62e8edafbcee"
107
+ TEMPLATE_GUIDS["Document File"] = "eb6f728d-fa54-4350-9807-1199cbf96851"
108
+ TEMPLATE_GUIDS["Integration Daemon"] = "6b3516f0-dd13-4786-9601-07215f995197"
109
+ TEMPLATE_GUIDS["XML Data File"] = "ea67ae71-c674-473e-b38b-689879d2a7d9"
110
+ TEMPLATE_GUIDS["Unity Catalog Schema"] = "5bf92b0f-3970-41ea-b0a3-aacfbf6fd92e"
111
+ TEMPLATE_GUIDS["Parquet Data File"] = "7f6cd744-79c3-4d25-a056-eeb1a91574c3"
112
+ TEMPLATE_GUIDS["3D Image Data File"] = "0059ea2b-6292-4cac-aa6f-a80a605f1114"
113
+ TEMPLATE_GUIDS["YAML File"] = "2221855b-2b64-4b45-a2ee-c40adc5e2a64"
114
+ TEMPLATE_GUIDS["Metadata Access Server"] = "bd8de890-fa79-4c24-aab8-20b41b5893dd"
115
+ TEMPLATE_GUIDS["Properties File"] = "3b281111-a0ef-4fc4-99e7-9a0ef84a7636"
116
+ TEMPLATE_GUIDS["Vector Data File"] = "db1bec7f-55a9-40d3-91c0-a57b76d422e2"
117
+ TEMPLATE_GUIDS["Apache Kafka Server"] = "5e1ff810-5418-43f7-b7c4-e6e062f9aff7"
118
+ INTEGRATION_GUIDS["KafkaTopic"] = "fa1f711c-0b34-4b57-8e6e-16162b132b0c"
119
+ TEMPLATE_GUIDS["Executable File"] = "3d99a163-7a13-4576-a212-784010a8302a"
120
+ TEMPLATE_GUIDS["Unity Catalog Table"] = "6cc1e5f5-4c1e-4290-a80e-e06643ffb13d"
121
+ TEMPLATE_GUIDS["JSON Data File"] = "c4836635-7e9e-446a-83b5-15e206b1aff3"
122
+ TEMPLATE_GUIDS["File System"] = "522f228c-097c-4f90-9efc-26c1f2696f87"
123
+ TEMPLATE_GUIDS["Source Code File"] = "9c7013ef-f29b-4b01-a8ea-5ea14f64c67a"
124
+ TEMPLATE_GUIDS["Apple MacBook Pro"] = "32a9fd56-85c9-47fe-a211-9da3871bf4da"
125
+ TEMPLATE_GUIDS["Build Instruction File"] = "fbb2fa2e-8bcb-402e-9be7-5c6db9f2c504"
126
+ TEMPLATE_GUIDS["Spreadsheet Data File"] = "e4fabff5-2ba9-4050-9076-6ed917970b4c"
127
+ TEMPLATE_GUIDS["UNIX File System"] = "27117270-8667-41d0-a99a-9118f9b60199"
128
+ TEMPLATE_GUIDS["Video Data File"] = "93b2b722-ec0f-4da4-960a-b8d4922f8bf5"
129
+ TEMPLATE_GUIDS["Unity Catalog Function"] = "a490ba65-6104-4213-9be9-524e16fed8aa"
130
+ TEMPLATE_GUIDS[
131
+ "PostgreSQL Relational Database Schema"
132
+ ] = "82a5417c-d882-4271-8444-4c6a996a8bfc"
133
+ TEMPLATE_GUIDS["Engine Host"] = "1764a891-4234-45f1-8cc3-536af40c790d"
134
+ TEMPLATE_GUIDS["Avro Data File"] = "9f5be428-058e-41dd-b506-3a222283b579"
135
+ TEMPLATE_GUIDS["Unity Catalog Volume"] = "92d2d2dc-0798-41f0-9512-b10548d312b7"
136
+ TEMPLATE_GUIDS["File"] = "ae3067c7-cc72-4a18-88e1-746803c2c86f"
137
+ TEMPLATE_GUIDS["Apache Kafka Topic"] = "ea8f81c9-c59c-47de-9525-7cc59d1251e5"
138
+ TEMPLATE_GUIDS["Script File"] = "dbd5e6bb-1ff8-46f4-a007-fb0485f68c92"
139
+ TEMPLATE_GUIDS["Apache Atlas Server"] = "fe6dce45-a978-4417-ab55-17f05b8bcea7"
140
+ TEMPLATE_GUIDS["Raster Data File"] = "47211156-f03f-4881-8526-015e695a3dac"
141
+ TEMPLATE_GUIDS["Data Folder"] = "372a0379-7060-4c9d-8d84-bc709b31794c"
142
+ TEMPLATE_GUIDS["OMAG Server Platform"] = "9b06c4dc-ddc8-47ae-b56b-28775d3a96f0"
143
+ INTEGRATION_GUIDS["OpenAPI"] = "b89d9a5a-2ea6-49bc-a4fc-e7df9f3ca93e"
144
+ INTEGRATION_GUIDS["PostgreSQLServerCataloguer"] = "36f69fd0-54ba-4f59-8a44-11ccf2687a34"
145
+ INTEGRATION_GUIDS[
146
+ "UnityCatalogInsideCatalogSynchronizer"
147
+ ] = "74dde22f-2249-4ea3-af2b-b39e73f79b81"
148
+ INTEGRATION_GUIDS["JDBCDatabaseCataloguer"] = "70dcd0b7-9f06-48ad-ad44-ae4d7a7762aa"
149
+ INTEGRATION_GUIDS["SampleDataCataloguer"] = "cd6479e1-2fe7-4426-b358-8a0cf70be117"
150
+ INTEGRATION_GUIDS["OpenAPICataloguer"] = "b89d9a5a-2ea6-49bc-a4fc-e7df9f3ca93e"
151
+ INTEGRATION_GUIDS["ApacheKafkaCataloguer"] = "fa1f711c-0b34-4b57-8e6e-16162b132b0c"
152
+ INTEGRATION_GUIDS[
153
+ "UnityCatalogServerSynchronizer"
154
+ ] = "06d068d9-9e08-4e67-8c59-073bbf1013af"
155
+ INTEGRATION_GUIDS["LandingAreaCataloguer"] = "1b98cdac-dd0a-4621-93db-99ef5a1098bc"
@@ -0,0 +1,217 @@
1
+ """
2
+ SPDX-License-Identifier: Apache-2.0
3
+ Copyright Contributors to the ODPi Egeria project.
4
+
5
+
6
+
7
+ This module provides a set of utility functions to render Mermaid markdown in a Jupyter notebook.
8
+
9
+ A running Egeria environment is needed to run these functions.
10
+ These functions have been tested in a Jupyter notebook - but may work in other environments.
11
+
12
+ """
13
+
14
+ import os
15
+ import time
16
+
17
+ import nest_asyncio
18
+
19
+ nest_asyncio.apply()
20
+ from pyegeria import (
21
+ AutomatedCuration,
22
+ InvalidParameterException,
23
+ PropertyServerException,
24
+ UserNotAuthorizedException,
25
+ )
26
+ from IPython.display import display, HTML
27
+ from rich.console import Console
28
+
29
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
30
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
31
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
32
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
33
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
34
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
35
+ )
36
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
37
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
38
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
39
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
40
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
41
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
42
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
43
+
44
+
45
+ def load_mermaid():
46
+ """Inject Mermaid.js library"""
47
+ mermaid_js = """
48
+ <script type="text/javascript">
49
+ if (!window.mermaid) {
50
+ var mermaidScript = document.createElement('script');
51
+ mermaidScript.src = "https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.9.1/mermaid.min.js";
52
+ document.head.appendChild(mermaidScript);
53
+ }
54
+ </script>
55
+ """
56
+ display(HTML(mermaid_js))
57
+
58
+
59
+ def render_mermaid(mermaid_code):
60
+ """Function to display a Mermaid diagram in a Jupyter notebook"""
61
+ mermaid_html = f"""
62
+ <div class="mermaid">
63
+ {mermaid_code}
64
+ </div>
65
+ <script type="text/javascript">
66
+ if (window.mermaid) {{
67
+ mermaid.initialize({{startOnLoad: true}});
68
+ mermaid.contentLoaded();
69
+ }}
70
+ </script>
71
+ """
72
+ display(HTML(mermaid_html))
73
+
74
+
75
+ def generate_process_graph(
76
+ process_guid: str = "508d3878-8eae-47e5-8507-ee936f33b418",
77
+ view_server: str = EGERIA_VIEW_SERVER,
78
+ url: str = EGERIA_VIEW_SERVER_URL,
79
+ user_id: str = EGERIA_USER,
80
+ user_pass: str = EGERIA_USER_PASSWORD,
81
+ ) -> str:
82
+ """Generate Mermaid Markdown text reflecting the Egeria process graph identified by the GUID
83
+
84
+ Parameters
85
+ ----------
86
+ process_guid: str
87
+ The identity of the progress to generate a graph of.
88
+
89
+ Returns
90
+ -------
91
+ str
92
+
93
+ A Mermaid markdown string
94
+
95
+ Raises
96
+ ------
97
+
98
+ InvalidParameterException
99
+ If the client passes incorrect parameters on the request - such as bad URLs or invalid values
100
+ PropertyServerException
101
+ Raised by the server when an issue arises in processing a valid request
102
+ NotAuthorizedException
103
+ The principle specified by the user_id does not have authorization for the requested action
104
+
105
+ """
106
+ console = Console()
107
+ a_client = AutomatedCuration(view_server, url, user_id, user_pass)
108
+ try:
109
+ token = a_client.create_egeria_bearer_token()
110
+
111
+ start_time = time.perf_counter()
112
+ response = a_client.get_gov_action_process_graph(process_guid)
113
+ duration = time.perf_counter() - start_time
114
+
115
+ if type(response) is dict:
116
+ process_steps: [dict]
117
+ step_links: [dict] = []
118
+ gov_process_qn = response["governanceActionProcess"]["processProperties"][
119
+ "qualifiedName"
120
+ ]
121
+ gov_process_dn = response["governanceActionProcess"]["processProperties"][
122
+ "displayName"
123
+ ]
124
+
125
+ md = f"\n---\ntitle: {gov_process_dn}\n---\nflowchart LR\n"
126
+ element = response["firstProcessStep"]["element"]
127
+ qname = element["processStepProperties"]["qualifiedName"]
128
+ dname = element["processStepProperties"]["displayName"]
129
+ domain_id = element["processStepProperties"]["domainIdentifier"]
130
+ guid = element["elementHeader"]["guid"]
131
+ wait = element["processStepProperties"]["waitTime"]
132
+ ignore_mult_trig = element["processStepProperties"][
133
+ "ignoreMultipleTriggers"
134
+ ]
135
+ link = response["firstProcessStep"]["linkGUID"]
136
+
137
+ md = f'{md}\nStep1[("`**{dname}**\n*nwait_time*: {wait}\n*nmult_trig*: {ignore_mult_trig}`")]'
138
+ process_steps = {
139
+ qname: {
140
+ "step": "Step1",
141
+ "displayName": dname,
142
+ "guid": guid,
143
+ "domain": domain_id,
144
+ "ignoreMultTrig": ignore_mult_trig,
145
+ "waitTime": wait,
146
+ "link_guid": link,
147
+ }
148
+ }
149
+ next_steps = response.get("nextProcessSteps", None)
150
+ if next_steps is not None:
151
+ i = 1
152
+ for step in next_steps:
153
+ i += 1
154
+ qname = step["processStepProperties"]["qualifiedName"]
155
+ dname = step["processStepProperties"]["displayName"]
156
+ wait = step["processStepProperties"]["waitTime"]
157
+ step = f"Step{i}"
158
+ md = f'{md}\n{step}("`**{dname}**\n*wait_time*: {wait}\n*mult_trig*: {ignore_mult_trig}`")'
159
+ process_steps.update(
160
+ {
161
+ qname: {
162
+ "step": step,
163
+ "displayName": dname,
164
+ "guid": guid,
165
+ "domain": domain_id,
166
+ "ignoreMultTrig": ignore_mult_trig,
167
+ "waitTime": wait,
168
+ }
169
+ }
170
+ ) # process_steps.append({qname: {"step": step,"displayName": dname, "waitTime": wait}})
171
+ # print(md)
172
+ # Now process the links
173
+ process_step_links = response.get("processStepLinks", None)
174
+ if process_step_links is not None:
175
+ for slink in process_step_links:
176
+ prev_step_name = slink["previousProcessStep"]["uniqueName"]
177
+ next_step_name = slink["nextProcessStep"]["uniqueName"]
178
+ next_step_link_guid = slink["nextProcessStepLinkGUID"]
179
+ guard = slink["guard"]
180
+ mandatory_guard = slink["mandatoryGuard"]
181
+ # print(f"\n\n Links: prev_step: {prev_step_name}\t next_step: {next_step_name}\t next_step_link:
182
+ # {next_step_link_guid}\t Guard: {guard}\t mandatory_guard: {mandatory_guard}")
183
+ step_links.append(
184
+ {
185
+ next_step_link_guid: {
186
+ "prev_step_name": prev_step_name,
187
+ "next_step_name": next_step_name,
188
+ "guard": guard,
189
+ "mandatory_guard": mandatory_guard,
190
+ }
191
+ }
192
+ )
193
+ step_p = process_steps[prev_step_name]["step"]
194
+ step_n = process_steps[next_step_name]["step"]
195
+ if mandatory_guard:
196
+ link = f"Mandatory:{guard}"
197
+ else:
198
+ link = guard
199
+ md = f"{md}\n{step_p}-->|{link}|{step_n}"
200
+ i = 1
201
+
202
+ return md
203
+
204
+ elif type(response) is str:
205
+ console.log("\n\n" + response)
206
+ assert True
207
+
208
+ except (
209
+ InvalidParameterException,
210
+ PropertyServerException,
211
+ UserNotAuthorizedException,
212
+ ) as e:
213
+ console.print_exception(show_locals=True)
214
+ assert False, "Invalid request"
215
+
216
+ finally:
217
+ a_client.close_session()
@@ -6,6 +6,7 @@ This module contains the MyProfile class and its methods.
6
6
  import asyncio
7
7
  import json
8
8
 
9
+ from pyegeria import body_slimmer
9
10
  from pyegeria._client import Client
10
11
  from pyegeria._validators import validate_name, validate_search_string
11
12
 
@@ -715,7 +716,7 @@ class MyProfile(Client):
715
716
  loop.run_until_complete(self._async_reassign_to_do(todo_guid, actor_guid, status, server_name))
716
717
  return
717
718
 
718
- async def _async_find_to_do(self, search_string: str = "*", server_name: str = "None", status: str = "OPEN",
719
+ async def _async_find_to_do(self, search_string: str = "*", server_name: str = "None", status: str = None,
719
720
  starts_with: bool = False, ends_with: bool = False, ignore_case: bool = True,
720
721
  start_from: int = 0, page_size: int = 100) -> list | str:
721
722
  """ find To-Do items. Async version.
@@ -770,7 +771,7 @@ class MyProfile(Client):
770
771
  f"find-by-search-string?startFrom={start_from}&pageSize={page_size}&"
771
772
  f"startsWith={starts_with_s}&endsWith={ends_with_s}&ignoreCase={ignore_case_s}")
772
773
 
773
- response = await self._async_make_request("POST", url, body)
774
+ response = await self._async_make_request("POST", url, body_slimmer(body))
774
775
  # return response.text
775
776
  return response.json().get("elements", "No ToDos found")
776
777
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.7.25
3
+ Version: 0.7.27
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -18,6 +18,7 @@ Requires-Dist: click (>=8.1.7,<9.0.0)
18
18
  Requires-Dist: confluent-kafka (>=2.5.0,<3.0.0)
19
19
  Requires-Dist: httpx (>=0.27.0,<0.28.0)
20
20
  Requires-Dist: jupyter (>=1.0.0,<2.0.0)
21
+ Requires-Dist: mermaid-py (>=0.5.3,<0.6.0)
21
22
  Requires-Dist: pytest (>=8.2.2,<9.0.0)
22
23
  Requires-Dist: requests (>=2.32.3,<3.0.0)
23
24
  Requires-Dist: rich (>=13.7.1,<14.0.0)
@@ -30,7 +30,7 @@ examples/widgets/my/list_my_roles.py,sha256=DCiNdnoHXQueUE5g73D3oRXfJ6LaUQGbibNt
30
30
  examples/widgets/my/monitor_my_todos.py,sha256=1580SOyq2RPsAyAkRxIpRHRxDvtI1xWfUrxylF6qKH4,6409
31
31
  examples/widgets/my/monitor_open_todos.py,sha256=oYmy5eRA_5BLhtkP8iI6pxci-8y6d13Vcw2F2yLawxY,5407
32
32
  examples/widgets/my/my_profile_actions.py,sha256=SrlC0PSix0b78MCWJdGJAVgai8gbJmYyz1ou2ZVOkIs,3949
33
- examples/widgets/my/todo_actions.py,sha256=TnQuo6JhofCBi1kmsyjTeUyT2Hs3U6IE10cfKBe0xzY,8248
33
+ examples/widgets/my/todo_actions.py,sha256=1T_FhjjMLOvMZjWGYvYOSd_R4JB-s8hIHiNSv0yx1QQ,8256
34
34
  examples/widgets/ops/README.md,sha256=PJsSDcvMv6E6og6y-cwvxFX5lhCII0UCwgKiM1T17MQ,1595
35
35
  examples/widgets/ops/__init__.py,sha256=SCfzF3-aMx8EpqLWmH7JQf13gTmMAtHRbg69oseLvi8,480
36
36
  examples/widgets/ops/engine_actions.py,sha256=i0-_wRJqdKARwnEwPQMJvr5bVEGi2WE9Np0_A-o6k3A,2978
@@ -62,7 +62,7 @@ examples/widgets/tech/list_tech_templates.py,sha256=RiyA8a4fIL9BGeGf37Bkk471mK5E
62
62
  examples/widgets/tech/list_valid_metadata_values.py,sha256=64z5tr-0VD-mPTFmr6FT76gj4MXJZLWTxT4oeIiUaiU,6043
63
63
  examples/widgets/tech/x_list_related_elements.py,sha256=hDiPThI9FLI63yoWEy7j7k_zLPBSlZIXYSaixiY_YAY,5785
64
64
  pyegeria/Xloaded_resources_omvs.py,sha256=cseWZTIwNhkzhZ0fhujI66DslNAQcjuwsz_p1GRmSPQ,3392
65
- pyegeria/__init__.py,sha256=2iz0GmjA8xBpn8bdLhnFYcFX12k0bfoxuOHZ3Nz97DA,7765
65
+ pyegeria/__init__.py,sha256=qeLvJihiXg4L22liNaiapQTBjmQc-8fb2JYl-Al0zeI,7857
66
66
  pyegeria/_client.py,sha256=mTK3qqaxwrwn4OiIKZkSkMVEsHPJsHxKmfz1LK_FgEg,26308
67
67
  pyegeria/_deprecated_gov_engine.py,sha256=_DAEHsksnTKGqL9-TaaMVrfnNOrvatNACfg7pJ-ZX4w,17600
68
68
  pyegeria/_exceptions.py,sha256=NJ7vAhmvusK1ENvY2MMrBB6A6TgpYjzS9QJxFH56b8c,18470
@@ -79,7 +79,8 @@ pyegeria/feedback_manager_omvs.py,sha256=I-Qn7IcrJ5FiSjaC8dIwOmBF8XOCsjl88Anq1xN
79
79
  pyegeria/full_omag_server_config.py,sha256=l4G0oM6l-axosYACypqNqzkF6wELzs9FgKJwvDMF0Fc,45817
80
80
  pyegeria/glossary_browser_omvs.py,sha256=nUCDSQ8cw8vuYgjfcaj1zLIefVI5j51evxPyXCIc4X8,101716
81
81
  pyegeria/glossary_manager_omvs.py,sha256=MsvsTyyTzLbaIQttfhM-izVP06VsdWAueJiiMeKbVwY,128512
82
- pyegeria/my_profile_omvs.py,sha256=gvodfLMTxCNBkK9pi28-sECNAkr-RiI1Y-eM-hiqsPg,42078
82
+ pyegeria/mermaid_utilities.py,sha256=mcrzDiA3bTf1kJDNiuAv2gS5LSsgD_LafMvyaHlbqMA,8292
83
+ pyegeria/my_profile_omvs.py,sha256=eVYzwgKM0kanDuSpMPpcXP0cJcT_nRsIGmSBdZztDp4,42124
83
84
  pyegeria/platform_services.py,sha256=T2UiAl7tPfOBGL_H2b73XyyHtR0Y36irgbaljZTjD4I,41808
84
85
  pyegeria/project_manager_omvs.py,sha256=RRPiyEqrcMY3jt3wK-7aEwY3c3PqEodAfDjEJx9duX0,77121
85
86
  pyegeria/registered_info.py,sha256=GfMcYz3IO0aNquf8qCrYQ9cA5KplhPx1kNt0_nMMpTM,6475
@@ -87,8 +88,8 @@ pyegeria/runtime_manager_omvs.py,sha256=oSVFeG_yBGXIvQR0EClLZqTZ6C5z5ReZzwm8cce8
87
88
  pyegeria/server_operations.py,sha256=1z2wZLdrNZG6HlswY_Eh8qI1mlcjsQ59zO-AMy9XbUU,16605
88
89
  pyegeria/utils.py,sha256=pkVmS3RrbjaS9yz7FtOCwaOfV5FMqz-__Rt5koCnd9c,5374
89
90
  pyegeria/valid_metadata_omvs.py,sha256=aisdRodIwJSkyArAzfm_sEnBELh69xE8k4Nea-vHu8M,36745
90
- pyegeria-0.7.25.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
91
- pyegeria-0.7.25.dist-info/METADATA,sha256=chqPgpdQehv6ZysNxRdANXlm1PcMcF_CHhSHaaFYuZM,2775
92
- pyegeria-0.7.25.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
93
- pyegeria-0.7.25.dist-info/entry_points.txt,sha256=22oy5-EM37ldb_-MPtiJygwXU217h8vb2_zT-7vn-yc,3571
94
- pyegeria-0.7.25.dist-info/RECORD,,
91
+ pyegeria-0.7.27.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
92
+ pyegeria-0.7.27.dist-info/METADATA,sha256=LTC85ELatJ8WZZLDdI_ZhaudKGAKU5eacRg8-FlZ9WY,2818
93
+ pyegeria-0.7.27.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
94
+ pyegeria-0.7.27.dist-info/entry_points.txt,sha256=22oy5-EM37ldb_-MPtiJygwXU217h8vb2_zT-7vn-yc,3571
95
+ pyegeria-0.7.27.dist-info/RECORD,,