pyegeria 5.4.4.8__py3-none-any.whl → 5.4.6__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.
- commands/cat/dr_egeria_command_help.py +0 -0
- commands/cat/exp_list_glossaries.py +0 -0
- commands/cat/get_collection.py +0 -0
- commands/cat/get_project_dependencies.py +0 -0
- commands/cat/get_project_structure.py +0 -0
- commands/cat/list_assets.py +0 -0
- commands/cat/list_cert_types.py +0 -0
- commands/cat/list_collections.py +0 -0
- commands/cat/list_data_designer.py +0 -0
- commands/cat/list_data_structures_full.py +0 -0
- commands/cat/list_deployed_servers.py +0 -0
- commands/cat/list_glossaries.py +0 -0
- commands/cat/list_projects.py +0 -0
- commands/cat/list_tech_types.py +0 -0
- commands/cat/list_terms.py +0 -0
- commands/cat/list_todos.py +0 -0
- commands/cli/egeria.py +0 -0
- commands/my/list_my_profile.py +0 -0
- commands/my/list_my_roles.py +0 -0
- commands/my/monitor_my_todos.py +0 -0
- commands/my/monitor_open_todos.py +0 -0
- commands/ops/list_archives.py +0 -0
- commands/ops/list_catalog_targets.py +0 -0
- commands/ops/monitor_asset_events.py +0 -0
- commands/ops/monitor_engine_activity.py +0 -0
- commands/ops/monitor_engine_activity_c.py +0 -0
- commands/ops/monitor_gov_eng_status.py +0 -0
- commands/ops/monitor_integ_daemon_status.py +0 -0
- commands/ops/monitor_platform_status.py +0 -0
- commands/ops/monitor_server_startup.py +0 -0
- commands/ops/monitor_server_status.py +0 -0
- commands/ops/orig_monitor_server_list.py +0 -0
- commands/ops/orig_monitor_server_status.py +0 -0
- commands/ops/table_integ_daemon_status.py +0 -0
- commands/tech/get_guid_info.py +0 -0
- commands/tech/get_tech_details.py +0 -0
- commands/tech/list_anchored_elements.py +0 -0
- commands/tech/list_asset_types.py +0 -0
- commands/tech/list_gov_action_processes.py +0 -0
- commands/tech/list_information_supply_chains.py +0 -0
- commands/tech/list_registered_services.py +0 -0
- commands/tech/list_relationship_types.py +0 -0
- commands/tech/list_relationships.py +0 -0
- commands/tech/list_solution_blueprints.py +0 -0
- commands/tech/list_solution_components.py +0 -0
- commands/tech/list_solution_roles.py +0 -0
- commands/tech/list_valid_metadata_values.py +0 -0
- md_processing/__init__.py +2 -0
- md_processing/dr_egeria.py +7 -4
- md_processing/md_commands/data_designer_commands.py +8 -3
- md_processing/md_commands/product_manager_commands.py +115 -12
- md_processing/md_commands/view_commands.py +3 -0
- md_processing/md_processing_utils/md_processing_constants.py +2 -1
- pyegeria/__init__.py +1 -0
- pyegeria/_client_new.py +1 -1
- pyegeria/_output_formats.py +50 -8
- pyegeria/automated_curation.py +122 -15
- pyegeria/collection_manager.py +28 -2
- pyegeria/data_designer.py +3 -3
- pyegeria/format_set_executor.py +159 -0
- pyegeria/mcp_adapter.py +110 -0
- pyegeria/mcp_server.py +176 -0
- pyegeria/project_manager.py +1 -1
- pyegeria/reference_data.py +1 -1
- pyegeria/x_action_author_omvs.py +1 -1
- {pyegeria-5.4.4.8.dist-info → pyegeria-5.4.6.dist-info}/METADATA +26 -29
- pyegeria-5.4.6.dist-info/RECORD +174 -0
- {pyegeria-5.4.4.8.dist-info → pyegeria-5.4.6.dist-info}/WHEEL +2 -1
- pyegeria-5.4.6.dist-info/entry_points.txt +105 -0
- pyegeria-5.4.6.dist-info/top_level.txt +3 -0
- commands/README.md +0 -47
- commands/cat/README.md +0 -16
- commands/cat/debug_log.2025-09-14_11-03-29_316193.log.zip +0 -0
- commands/cat/debug_log.2025-09-15_19-06-37_086464.log.zip +0 -0
- commands/cat/debug_log.2025-09-20_11-10-54_418109.log.zip +0 -0
- commands/cli/debug_log +0 -0
- commands/cli/txt_custom_v2.tcss +0 -19
- commands/doc/README.md +0 -145
- commands/doc/Visual Command Reference/README.md +0 -511
- commands/doc/Visual Command Reference/cat/show/assets/asset-graph 2024-11-20 at 15.56.42.png +0 -0
- commands/doc/Visual Command Reference/cat/show/assets/assets-in-domain 2024-11-20 at 15.49.55@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/assets/elements-of-type 2024-11-20 at 16.01.35.png +0 -0
- commands/doc/Visual Command Reference/cat/show/assets/tech-type-elements 2024-11-20 at 16.05.05.png +0 -0
- commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs 2024-12-17 at 15.43.27@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-data-catalogs-2024-11-20 at 16.17.43@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-11-25 at 20.14.50@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-schemas 2024-12-17 at 15.48.38@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-11-25 at 20.21.25@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/deployed-data/deployed-servers 2024-12-17 at 15.52.16@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/deployed-data/deployed_databases 2024-12-16 at 16.40.31@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/glossary/list-glossaries 2024-11-25 at 20.30.02.png +0 -0
- commands/doc/Visual Command Reference/cat/show/glossary/list-terms 2024-11-25 at 20.32.11.png +0 -0
- commands/doc/Visual Command Reference/cat/show/info/asset-types 2024-11-25 at 20.34.19@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/info/certification-types 2024-11-25 at 20.37.07.png +0 -0
- commands/doc/Visual Command Reference/cat/show/info/collection-graph 2024-12-12 at 11.33.18@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/info/list-collections 2024-12-10 at 14.25.51@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/info/list-todos 2024-12-12 at 11.46.30@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/info/list-user-ids 2024-12-12 at 11.51.09@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/info/tech-types 2024-12-12 at 11.37.20@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/projects/project_dependencies 2024-12-14 at 16.24.39@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/projects/project_structure 2024-12-14 at 16.21.35@2x.png +0 -0
- commands/doc/Visual Command Reference/cat/show/projects/projects 2024-12-14 at 16.18.10@2x.png +0 -0
- commands/doc/Visual Command Reference/hey_egeria tui 2024-12-16 at 16.58.22@2x.png +0 -0
- commands/doc/Visual Command Reference/my/show/my_profile 2024-12-14 at 16.29.27@2x.png +0 -0
- commands/doc/Visual Command Reference/my/show/my_roles 2024-12-14 at 16.32.10@2x.png +0 -0
- commands/doc/Visual Command Reference/my/show/my_todos 2024-12-15 at 16.24.13@2x.png +0 -0
- commands/doc/Visual Command Reference/my/show/open_todos 2024-12-14 at 16.36.12@2x.png +0 -0
- commands/doc/Visual Command Reference/ops/show/engines/list_engine_activity compressed 2024-12-15 at 16.48.48@2x.png +0 -0
- commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity 2024-12-15 at 16.32.55@2x.png +0 -0
- commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_activity compressed 2024-12-15 at 16.38.29@2x.png +0 -0
- commands/doc/Visual Command Reference/ops/show/engines/monitor_engine_status 2024-12-15 at 16.51.26.jpeg +0 -0
- commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_daemon_status 2024-12-15 at 16.57.12@2x.png +0 -0
- commands/doc/Visual Command Reference/ops/show/integrations/monitor_integration_targets 2024-12-15 at 17.02.19@2x.png +0 -0
- commands/doc/Visual Command Reference/ops/show/platforms/monitor_platform_status 2024-12-15 at 19.53.18@2x.png +0 -0
- commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status 2024-12-15 at 19.59.39@2x.png +0 -0
- commands/doc/Visual Command Reference/ops/show/servers/monitor_server_status full 2024-12-15 at 20.01.57@2x.png +0 -0
- commands/doc/Visual Command Reference/ops/show/servers/monitor_startup_servers 2024-12-15 at 19.56.07@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/elements/get_anchored_elements 2024-12-15 at 21.25.41@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/elements/get_elements_of_om_type 2024-12-16 at 14.39.59@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/elements/info_for_guid 2024-12-16 at 11.35.29@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type 2024-12-16 at 14.24.18@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/elements/list_elements_by_om-type extended 2024-12-16 at 14.28.46@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/elements/list_elements_of_om_type_by_classification 2024-12-16 at 14.35.26@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/elements/related_elements 2024-12-16 at 14.55.01@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/elements/show_related_specifications 2024-12-16 at 15.04.55@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-info/asset_types 2024-12-16 at 15.10.16@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-info/detailed_governance_action_processes 2024-12-16 at 15.16.26@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-info/governance_action_processes 2024-12-16 at 15.13.01@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-info/registered_services 2024-12-16 at 16.44.54@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-16 at 16.20.34@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-info/relationship_types 2024-12-19 at 10.51.54@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-info/valid_metadata_values 2024-12-16 at 15.31.56@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-types/list_tech_type_template_specs 2024-12-16 at 16.03.22@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-types/list_technology_types 2024-12-16 at 15.39.20@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_details 2024-12-16 at 15.37.21@2x.png +0 -0
- commands/doc/Visual Command Reference/tech/show/tech-types/tech_type_templates 2024-12-16 at 16.11.48@2x.png +0 -0
- commands/doc/glossary/basic-glossary-tui.md +0 -109
- commands/doc/glossary/images/delete-glossary-step1 2024-11-06 at 15.47.23@2x.png +0 -0
- commands/doc/glossary/images/delete-glossary-step2 2024-11-06 at 15.51.29@2x.png +0 -0
- commands/doc/glossary/images/delete-glossary-step3 2024-11-06 at 15.53.19@2x.png +0 -0
- commands/doc/glossary/images/delete-glossary-step4 2024-11-06 at 15.55.11@2x.png +0 -0
- commands/doc/glossary/images/out-create-glossary example 2024-11-05 at 20.38.04@2x.png +0 -0
- commands/doc/glossary/images/out-create-term 2024-11-06 at 20.48.29.png +0 -0
- commands/doc/glossary/images/out-delete-term 2024-11-07 at 03.57.25.png +0 -0
- commands/doc/glossary/images/out-display-terms-for-glossary-test 2024-11-06 at 20.51.28.png +0 -0
- commands/doc/glossary/images/out-export-example 2024-11-07 at 09.54.57.png +0 -0
- commands/doc/glossary/images/out-exported-terms 2024-11-06 at 21.06.32.png +0 -0
- commands/doc/glossary/images/out-glossary-list example 2024-11-05 at 20.41.02@2x.png +0 -0
- commands/doc/glossary/images/out-import-terms 2024-11-07 at 08.15.18.png +0 -0
- commands/doc/glossary/images/out-list-all-terms 2024-11-06 at 16.22.20@2x.png +0 -0
- commands/doc/glossary/images/out-list-terms-for-example 2024-11-06 at 16.40.12.png +0 -0
- commands/doc/glossary/images/out-list-terms-second 2024-11-06 at 16.45.13.png +0 -0
- commands/doc/glossary/images/out-pipx install pyegeria 2024-11-10 at 18.12.21.png +0 -0
- commands/doc/glossary/images/out-server-status-full 2024-11-10 at 18.25.14.png +0 -0
- commands/doc/glossary/images/out-servers-status 2024-11-10 at 18.15.42.png +0 -0
- commands/doc/glossary/images/out-upsert-import 2024-11-07 at 19.37.00.png +0 -0
- commands/doc/glossary/images/tui-2024-11-10 at 18.26.29.png +0 -0
- commands/doc/glossary/images/tui-create-glossary example 2024-11-05 at 20.34.24@2x.png +0 -0
- commands/doc/glossary/images/tui-create-term 2024-11-06 at 20.46.35.png +0 -0
- commands/doc/glossary/images/tui-delete-term 2024-11-07 at 03.51.57.png +0 -0
- commands/doc/glossary/images/tui-display-terms-for-example 2024-11-06 at 20.56.49.png +0 -0
- commands/doc/glossary/images/tui-export-example 2024-11-07 at 09.52.59.png +0 -0
- commands/doc/glossary/images/tui-hey-egeria 2024-11-10 at 18.31.01.png +0 -0
- commands/doc/glossary/images/tui-import-upsert-example 2024-11-07 at 10.08.37.png +0 -0
- commands/doc/glossary/images/tui-list-terms-second 2024-11-06 at 16.46.34.png +0 -0
- commands/doc/glossary/images/tui-load-archive.png +0 -0
- commands/doc/glossary/images/tui-server-status-full 2024-11-10 at 19.14.36.png +0 -0
- commands/doc/glossary/images/tui-show-glossaries 2024-11-07 at 20.00.05.png +0 -0
- commands/doc/glossary/images/tui-show-glossary-terms 2024-11-05 at 19.37.53@2x.png +0 -0
- commands/doc/glossary/images/tui-upsert 2024-11-07 at 11.49.04.png +0 -0
- commands/doc/glossary/images/upsert-example.om-terms 2024-11-07 at 11.44.05.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/README.md +0 -346
- commands/doc/hey_egeria: a pyegeria command line interface/images/CleanShot 2024-11-18 at 21.32.03@2x.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731421782704.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/Xmind 1731422134920.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria 2024-11-12 at 20.38.43.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/hey_egeria cat 2024-11-12 at 21.41.43.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/out-integ-status-list 2024-11-12 at 16.45.26.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/out-integ-status-live 2024-11-12 at 16.44.12@2x.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/out-server-status 2024-11-10 at 18.15.42@2x.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/out-server-status-full 2024-11-10 at 18.25.14@2x.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/short-cut commands 2024-11-12 at 22.22.13.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/tui-hey-egeria.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/tui-integration-status-paging.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/tui-load-archive 2024-11-10 at 19.19.09@2x.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/tui-show-server-status 2024-11-10 at 18.52.01@2x.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/tui-show-server-status-full 2024-11-10.png +0 -0
- commands/doc/hey_egeria: a pyegeria command line interface/images/tui-status-paging 2024-11-12 at 16.26.14@2x.png +0 -0
- commands/my/README.md +0 -17
- commands/ops/README.md +0 -24
- commands/tech/README.md +0 -24
- md_processing/.obsidian/app.json +0 -1
- md_processing/.obsidian/appearance.json +0 -1
- md_processing/.obsidian/community-plugins.json +0 -1
- md_processing/.obsidian/core-plugins.json +0 -33
- md_processing/.obsidian/workspace.json +0 -167
- md_processing/data/commands-working.json +0 -34850
- md_processing/data/commands.json +0 -51697
- md_processing/data/generated_format_sets.json +0 -4137
- md_processing/dr-egeria-outbox/DataStruct-DrE-2025-09-19-22-35-57.md +0 -46
- md_processing/dr-egeria-outbox/Digital Products-2025-09-21-16-52-50.md +0 -51
- md_processing/dr-egeria-outbox/Digital-Product-Catalog-2025-09-21-16-55-19.md +0 -77
- md_processing/dr_egeria_inbox/glossary_creation_experiment.ipynb +0 -341
- md_processing/md_processing_utils/debug_log +0 -84
- md_processing/md_processing_utils/dr-egeria-help-2025-09-09T11:10:03.md +0 -3305
- md_processing/md_processing_utils/dr-egeria-help-2025-09-10T14:49:49.md +0 -3460
- md_processing/md_processing_utils/dr-egeria-help-2025-09-10T14:57:46.md +0 -472
- pyegeria/README.md +0 -35
- pyegeria-5.4.4.8.dist-info/RECORD +0 -308
- pyegeria-5.4.4.8.dist-info/entry_points.txt +0 -105
- {pyegeria-5.4.4.8.dist-info → pyegeria-5.4.6.dist-info/licenses}/LICENSE +0 -0
pyegeria/automated_curation.py
CHANGED
@@ -54,7 +54,7 @@ class AutomatedCuration(Client2):
|
|
54
54
|
Client2.__init__(self, view_server, platform_url, user_id, user_pwd, token=token)
|
55
55
|
self.curation_command_root = f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/automated-curation"
|
56
56
|
|
57
|
-
async def
|
57
|
+
async def _async_create_elem_from_template(self, body: dict) -> str:
|
58
58
|
"""Create a new metadata element from a template. Async version.
|
59
59
|
Parameters
|
60
60
|
----------
|
@@ -99,9 +99,9 @@ class AutomatedCuration(Client2):
|
|
99
99
|
"""
|
100
100
|
|
101
101
|
url = f"{self.curation_command_root}/catalog-templates/new-element"
|
102
|
-
return await self.
|
102
|
+
return await self._async_create_element_from_template(url, body)
|
103
103
|
|
104
|
-
def
|
104
|
+
def create_elem_from_template(self, body: dict) -> str:
|
105
105
|
"""Create a new metadata element from a template. Async version.
|
106
106
|
Parameters
|
107
107
|
----------
|
@@ -147,10 +147,11 @@ class AutomatedCuration(Client2):
|
|
147
147
|
"""
|
148
148
|
loop = asyncio.get_event_loop()
|
149
149
|
response = loop.run_until_complete(
|
150
|
-
self.
|
150
|
+
self._async_create_elem_from_template(body)
|
151
151
|
)
|
152
152
|
return response
|
153
153
|
|
154
|
+
|
154
155
|
async def _async_create_kafka_server_element_from_template(
|
155
156
|
self,
|
156
157
|
kafka_server: str,
|
@@ -194,7 +195,7 @@ class AutomatedCuration(Client2):
|
|
194
195
|
},
|
195
196
|
}
|
196
197
|
body_s = body_slimmer(body)
|
197
|
-
return await self.
|
198
|
+
return await self._async_create_elem_from_template(body_s)
|
198
199
|
|
199
200
|
def create_kafka_server_element_from_template(
|
200
201
|
self,
|
@@ -289,7 +290,7 @@ class AutomatedCuration(Client2):
|
|
289
290
|
},
|
290
291
|
}
|
291
292
|
body_s = body_slimmer(body)
|
292
|
-
return await self.
|
293
|
+
return await self._async_create_elem_from_template(body_s)
|
293
294
|
|
294
295
|
def create_csv_data_file_element_from_template(
|
295
296
|
self,
|
@@ -337,6 +338,112 @@ class AutomatedCuration(Client2):
|
|
337
338
|
)
|
338
339
|
return response
|
339
340
|
|
341
|
+
async def _async_get_create_csv_data_file_element_from_template(
|
342
|
+
self,
|
343
|
+
file_name: str,
|
344
|
+
file_type: str,
|
345
|
+
file_path_name: str,
|
346
|
+
version_identifier: str,
|
347
|
+
file_encoding: str = "UTF-8",
|
348
|
+
file_extension: str = "csv",
|
349
|
+
file_system_name: str = None,
|
350
|
+
description: str = None,
|
351
|
+
) -> str:
|
352
|
+
"""Create a CSV file element from a template if it doesn't exist. If it does exist,
|
353
|
+
the guid will be returned. Async version.
|
354
|
+
|
355
|
+
Parameters
|
356
|
+
----------
|
357
|
+
file_name : str
|
358
|
+
The name of the Kafka server.
|
359
|
+
file_type : str
|
360
|
+
The host name of the Kafka server.
|
361
|
+
file_path_name : str
|
362
|
+
The port number of the Kafka server.
|
363
|
+
version_identifier : str
|
364
|
+
The version identifier of the CSV file..
|
365
|
+
file_encoding: str, opt, default UTF-8
|
366
|
+
The encoding of the CSV file.
|
367
|
+
file_extension: str, opt, default is CSV
|
368
|
+
File extension of the CSV file.
|
369
|
+
file_system_name: str, opt
|
370
|
+
Name of the file system the CSV file is hosted on.
|
371
|
+
description: str, opt
|
372
|
+
A description of the CSV file..
|
373
|
+
|
374
|
+
|
375
|
+
Returns
|
376
|
+
-------
|
377
|
+
str
|
378
|
+
The GUID of the CSV File element.
|
379
|
+
"""
|
380
|
+
template_guid = await self._async_get_template_guid_for_technology_type("CSV Data File")
|
381
|
+
body = {
|
382
|
+
"class": "TemplateRequestBody",
|
383
|
+
"templateGUID": template_guid,
|
384
|
+
"isOwnAnchor": True,
|
385
|
+
"allowRetrieve" : True,
|
386
|
+
"placeholderPropertyValues": {
|
387
|
+
"fileName": file_name,
|
388
|
+
"fileType": file_type,
|
389
|
+
"filePathName": file_path_name,
|
390
|
+
"versionIdentifier": version_identifier,
|
391
|
+
"fileEncoding": file_encoding,
|
392
|
+
"fileExtension": file_extension,
|
393
|
+
"fileSystemName": file_system_name,
|
394
|
+
"description": description
|
395
|
+
},
|
396
|
+
}
|
397
|
+
body_s = body_slimmer(body)
|
398
|
+
return await self._async_create_elem_from_template(body_s)
|
399
|
+
|
400
|
+
def get_create_csv_data_file_element_from_template(
|
401
|
+
self,
|
402
|
+
file_name: str,
|
403
|
+
file_type: str,
|
404
|
+
file_path_name: str,
|
405
|
+
version_identifier: str,
|
406
|
+
file_encoding: str = "UTF-8",
|
407
|
+
file_extension: str = "csv",
|
408
|
+
file_system_name: str = None,
|
409
|
+
description: str = None,
|
410
|
+
) -> str:
|
411
|
+
"""Create a CSV file element from a template if it doesn't exist. If it does exist,
|
412
|
+
the guid will be returned.
|
413
|
+
|
414
|
+
Parameters
|
415
|
+
----------
|
416
|
+
file_name : str
|
417
|
+
The name of the Kafka server.
|
418
|
+
file_type : str
|
419
|
+
The host name of the Kafka server.
|
420
|
+
file_path_name : str
|
421
|
+
The port number of the Kafka server.
|
422
|
+
version_identifier : str
|
423
|
+
The version identifier of the CSV file..
|
424
|
+
file_encoding: str, opt, default UTF-8
|
425
|
+
The encoding of the CSV file.
|
426
|
+
file_extension: str, opt, default is CSV
|
427
|
+
File extension of the CSV file.
|
428
|
+
file_system_name: str, opt
|
429
|
+
Name of the file system the CSV file is hosted on.
|
430
|
+
description: str, opt
|
431
|
+
A description of the CSV file..
|
432
|
+
|
433
|
+
Returns
|
434
|
+
-------
|
435
|
+
str
|
436
|
+
The GUID of the CSV File element.
|
437
|
+
"""
|
438
|
+
loop = asyncio.get_event_loop()
|
439
|
+
response = loop.run_until_complete(
|
440
|
+
self._async_get_create_csv_data_file_element_from_template(
|
441
|
+
file_name, file_type, file_path_name, version_identifier,
|
442
|
+
file_encoding, file_extension, file_system_name, description
|
443
|
+
)
|
444
|
+
)
|
445
|
+
return response
|
446
|
+
|
340
447
|
async def _async_create_postgres_server_element_from_template(
|
341
448
|
self,
|
342
449
|
postgres_server: str,
|
@@ -391,7 +498,7 @@ class AutomatedCuration(Client2):
|
|
391
498
|
},
|
392
499
|
}
|
393
500
|
body_s = body_slimmer(body)
|
394
|
-
return await self.
|
501
|
+
return await self._async_create_elem_from_template(body_s)
|
395
502
|
|
396
503
|
def create_postgres_server_element_from_template(
|
397
504
|
self,
|
@@ -490,7 +597,7 @@ class AutomatedCuration(Client2):
|
|
490
597
|
},
|
491
598
|
}
|
492
599
|
body_s = body_slimmer(body)
|
493
|
-
response = await self.
|
600
|
+
response = await self._async_create_elem_from_template(body_s)
|
494
601
|
return str(response)
|
495
602
|
|
496
603
|
def create_postgres_database_element_from_template(
|
@@ -592,7 +699,7 @@ class AutomatedCuration(Client2):
|
|
592
699
|
},
|
593
700
|
}
|
594
701
|
body_s = body_slimmer(body)
|
595
|
-
response = await self.
|
702
|
+
response = await self._async_create_elem_from_template(body_s)
|
596
703
|
return str(response)
|
597
704
|
|
598
705
|
def create_folder_element_from_template(
|
@@ -687,7 +794,7 @@ class AutomatedCuration(Client2):
|
|
687
794
|
},
|
688
795
|
}
|
689
796
|
body_s = body_slimmer(body)
|
690
|
-
response = await self.
|
797
|
+
response = await self._async_create_elem_from_template(body_s)
|
691
798
|
return str(response)
|
692
799
|
|
693
800
|
def create_uc_server_element_from_template(
|
@@ -776,7 +883,7 @@ class AutomatedCuration(Client2):
|
|
776
883
|
},
|
777
884
|
}
|
778
885
|
body_s = body_slimmer(body)
|
779
|
-
response = await self.
|
886
|
+
response = await self._async_create_elem_from_template(body_s)
|
780
887
|
return str(response)
|
781
888
|
|
782
889
|
def create_uc_catalog_element_from_template(
|
@@ -866,7 +973,7 @@ class AutomatedCuration(Client2):
|
|
866
973
|
},
|
867
974
|
}
|
868
975
|
body_s = body_slimmer(body)
|
869
|
-
response = await self.
|
976
|
+
response = await self._async_create_elem_from_template(body_s)
|
870
977
|
return str(response)
|
871
978
|
|
872
979
|
def create_uc_schema_element_from_template(
|
@@ -977,7 +1084,7 @@ class AutomatedCuration(Client2):
|
|
977
1084
|
},
|
978
1085
|
}
|
979
1086
|
body_s = body_slimmer(body)
|
980
|
-
response = await self.
|
1087
|
+
response = await self._async_create_elem_from_template(body_s)
|
981
1088
|
return str(response)
|
982
1089
|
|
983
1090
|
def create_uc_table_element_from_template(
|
@@ -1097,7 +1204,7 @@ class AutomatedCuration(Client2):
|
|
1097
1204
|
},
|
1098
1205
|
}
|
1099
1206
|
body_s = body_slimmer(body)
|
1100
|
-
response = await self.
|
1207
|
+
response = await self._async_create_elem_from_template(body_s)
|
1101
1208
|
return str(response)
|
1102
1209
|
|
1103
1210
|
def create_uc_function_element_from_template(
|
@@ -1214,7 +1321,7 @@ class AutomatedCuration(Client2):
|
|
1214
1321
|
},
|
1215
1322
|
}
|
1216
1323
|
body_s = body_slimmer(body)
|
1217
|
-
response = await self.
|
1324
|
+
response = await self._async_create_elem_from_template(body_s)
|
1218
1325
|
return str(response)
|
1219
1326
|
|
1220
1327
|
def create_uc_volume_element_from_template(
|
pyegeria/collection_manager.py
CHANGED
@@ -5571,8 +5571,34 @@ class CollectionManager(Client2):
|
|
5571
5571
|
if isinstance(resources, (list | dict)):
|
5572
5572
|
resource_list = ""
|
5573
5573
|
for resource in resources:
|
5574
|
-
resource_list += f"{resource
|
5575
|
-
added_props["resource_list"] = resource_list[:-2]
|
5574
|
+
resource_list += f"{resource.get('properties',{}).get('qualifiedName', None)}, "
|
5575
|
+
added_props["resource_list"] = resource_list[:-2] if resource_list else ""
|
5576
|
+
|
5577
|
+
actors = element.get("assignedActors", "")
|
5578
|
+
if isinstance(actors, (list | dict)):
|
5579
|
+
actor_list = ""
|
5580
|
+
for actor in actors:
|
5581
|
+
actor_type = actor['relatedElement']['elementHeader']['type']['typeName']
|
5582
|
+
actor_qname = actor['relatedElement']['properties']['qualifiedName']
|
5583
|
+
actor_list += actor_qname
|
5584
|
+
added_props["actor_list"] = actor_list[:-2] if actor_list else ""
|
5585
|
+
|
5586
|
+
governed_by = element.get("governedBy", "")
|
5587
|
+
if isinstance(governed_by, (list | dict)):
|
5588
|
+
governed_by_list = ""
|
5589
|
+
for gov in governed_by:
|
5590
|
+
license_type = gov['relatedElement']['properties'].get('typeName',"")
|
5591
|
+
license_type_qname = gov['relatedElement']['properties'].get('qualifiedName','')
|
5592
|
+
governed_by_list += license_type_qname
|
5593
|
+
added_props["governed_list"] = governed_by_list[:-2] if governed_by_list else ""
|
5594
|
+
|
5595
|
+
solution_designs = element.get("solutionDesigns", "")
|
5596
|
+
if isinstance(solution_designs, (list | dict)):
|
5597
|
+
solution_design_list = ""
|
5598
|
+
for design in solution_designs:
|
5599
|
+
solution_design_qname = design['relatedElement']['properties'].get('qualifiedName', "")
|
5600
|
+
solution_design_list += solution_design_qname
|
5601
|
+
added_props["solution_design_list"] = solution_design_list[:-2] if solution_design_list else ""
|
5576
5602
|
|
5577
5603
|
return added_props
|
5578
5604
|
|
pyegeria/data_designer.py
CHANGED
@@ -280,7 +280,7 @@ class DataDesigner(Client2):
|
|
280
280
|
|
281
281
|
"""
|
282
282
|
url = f"{self.data_designer_root}/data-structures/from-template"
|
283
|
-
return await self.
|
283
|
+
return await self._async_create_element_from_template(url, body)
|
284
284
|
|
285
285
|
@dynamic_catch
|
286
286
|
def create_data_structure_from_template(self, body: dict | TemplateRequestBody) -> str:
|
@@ -1696,7 +1696,7 @@ class DataDesigner(Client2):
|
|
1696
1696
|
|
1697
1697
|
url = f"{base_path(self, self.view_server)}/data-fields/from-template"
|
1698
1698
|
|
1699
|
-
return await self.
|
1699
|
+
return await self._async_create_element_from_template(url, body)
|
1700
1700
|
|
1701
1701
|
@dynamic_catch
|
1702
1702
|
def create_data_field_from_template(self, body: dict | TemplateRequestBody) -> str:
|
@@ -2945,7 +2945,7 @@ class DataDesigner(Client2):
|
|
2945
2945
|
"""
|
2946
2946
|
|
2947
2947
|
url = f"{base_path(self, self.view_server)}/data-classes/from-template"
|
2948
|
-
return await self.
|
2948
|
+
return await self._async_create_element_from_template(url, body)
|
2949
2949
|
|
2950
2950
|
@dynamic_catch
|
2951
2951
|
def create_data_class_from_template(self, body: dict | TemplateRequestBody) -> str:
|
@@ -0,0 +1,159 @@
|
|
1
|
+
"""
|
2
|
+
SPDX-License-Identifier: Apache-2.0
|
3
|
+
Copyright Contributors to the ODPi Egeria project.
|
4
|
+
|
5
|
+
A pure helper to execute a FormatSet action and return normalized results without side effects
|
6
|
+
(printing or writing to disk). This is suitable for programmatic use (e.g., MCP adapters,
|
7
|
+
notebooks, services) that want DICT/JSON or text output directly.
|
8
|
+
|
9
|
+
Notes
|
10
|
+
- Only use this for read-style format sets. It assumes the action is safe to call.
|
11
|
+
- Credentials and endpoints default from pyegeria.config.settings (ENV/config.json/ENV files).
|
12
|
+
- Prefer output_format="DICT" for machine-consumable results. REPORT/HTML/MERMAID are returned as text.
|
13
|
+
"""
|
14
|
+
from __future__ import annotations
|
15
|
+
|
16
|
+
import json
|
17
|
+
from typing import Any, Dict, Optional
|
18
|
+
|
19
|
+
from loguru import logger
|
20
|
+
|
21
|
+
from pyegeria import (
|
22
|
+
EgeriaTech,
|
23
|
+
CollectionManager,
|
24
|
+
GovernanceOfficer,
|
25
|
+
GlossaryManager,
|
26
|
+
NO_ELEMENTS_FOUND,
|
27
|
+
)
|
28
|
+
from pyegeria.config import settings
|
29
|
+
from pyegeria.external_references import ExternalReferences
|
30
|
+
from pyegeria._exceptions_new import PyegeriaException
|
31
|
+
from pyegeria._output_formats import (
|
32
|
+
select_output_format_set,
|
33
|
+
get_output_format_set_heading,
|
34
|
+
get_output_format_set_description,
|
35
|
+
)
|
36
|
+
|
37
|
+
|
38
|
+
_CLIENT_CLASS_MAP = {
|
39
|
+
"CollectionManager": CollectionManager,
|
40
|
+
"GovernanceOfficer": GovernanceOfficer,
|
41
|
+
"GlossaryManager": GlossaryManager,
|
42
|
+
"ExternalReference": ExternalReferences,
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
def _resolve_client_and_method(func_decl: str):
|
47
|
+
"""Given a function declaration like 'ClassName.method', return (client_class, method_name)."""
|
48
|
+
if not isinstance(func_decl, str) or "." not in func_decl:
|
49
|
+
return (EgeriaTech, None)
|
50
|
+
class_name, method_name = func_decl.split(".", 1)
|
51
|
+
client_class = _CLIENT_CLASS_MAP.get(class_name, EgeriaTech)
|
52
|
+
return (client_class, method_name)
|
53
|
+
|
54
|
+
|
55
|
+
def run_format_set_action_return(
|
56
|
+
format_set_name: str,
|
57
|
+
*,
|
58
|
+
output_format: str = "DICT",
|
59
|
+
params: Optional[Dict[str, Any]] = None,
|
60
|
+
view_server: str = settings.Environment.egeria_view_server,
|
61
|
+
view_url: str = settings.Environment.egeria_view_server_url,
|
62
|
+
user: str = settings.User_Profile.user_name,
|
63
|
+
user_pass: str = settings.User_Profile.user_pwd,
|
64
|
+
) -> Dict[str, Any]:
|
65
|
+
"""
|
66
|
+
Execute the action for a given format set and return a normalized result structure.
|
67
|
+
|
68
|
+
Returns shapes:
|
69
|
+
- {"kind":"empty"}
|
70
|
+
- {"kind":"json","data": <list|dict|any>}
|
71
|
+
- {"kind":"text","mime": "text/markdown"|"text/html","content": str}
|
72
|
+
- {"kind":"unknown","raw": any}
|
73
|
+
"""
|
74
|
+
output_format = (output_format or "DICT").upper()
|
75
|
+
params = dict(params or {})
|
76
|
+
|
77
|
+
# Resolve the format set and action
|
78
|
+
fmt = select_output_format_set(format_set_name, output_format)
|
79
|
+
if not fmt:
|
80
|
+
raise ValueError(
|
81
|
+
f"Output format set '{format_set_name}' does not have a compatible '{output_format}' format."
|
82
|
+
)
|
83
|
+
if "action" not in fmt:
|
84
|
+
raise ValueError(f"Output format set '{format_set_name}' does not have an action property.")
|
85
|
+
|
86
|
+
action = fmt["action"]
|
87
|
+
func_decl = action.get("function")
|
88
|
+
required_params = action.get("required_params", action.get("user_params", [])) or []
|
89
|
+
optional_params = action.get("optional_params", []) or []
|
90
|
+
spec_params = action.get("spec_params", {}) or {}
|
91
|
+
|
92
|
+
# Build call params: required/optional provided by caller + fixed spec_params
|
93
|
+
call_params: Dict[str, Any] = {}
|
94
|
+
|
95
|
+
# Populate required and optional params when provided
|
96
|
+
for p in required_params:
|
97
|
+
if p in params and params[p] is not None:
|
98
|
+
call_params[p] = params[p]
|
99
|
+
elif p not in spec_params:
|
100
|
+
# Missing required param
|
101
|
+
logger.warning(f"Required parameter '{p}' not provided for format set '{format_set_name}'.")
|
102
|
+
for p in optional_params:
|
103
|
+
if p in params and params[p] is not None:
|
104
|
+
call_params[p] = params[p]
|
105
|
+
|
106
|
+
# Include fixed specifics
|
107
|
+
call_params.update(spec_params)
|
108
|
+
|
109
|
+
# Always include output_format and output_format_set for downstream rendering
|
110
|
+
call_params["output_format"] = output_format
|
111
|
+
call_params["output_format_set"] = format_set_name
|
112
|
+
|
113
|
+
client_class, method_name = _resolve_client_and_method(func_decl)
|
114
|
+
client = client_class(view_server, view_url, user_id=user, user_pwd=user_pass)
|
115
|
+
|
116
|
+
try:
|
117
|
+
client.create_egeria_bearer_token()
|
118
|
+
func = getattr(client, method_name) if method_name and hasattr(client, method_name) else None
|
119
|
+
if func is None:
|
120
|
+
raise AttributeError(
|
121
|
+
f"Method '{method_name}' not found in client class '{client_class.__name__}'."
|
122
|
+
)
|
123
|
+
|
124
|
+
result = func(**call_params)
|
125
|
+
|
126
|
+
if not result or result == NO_ELEMENTS_FOUND:
|
127
|
+
return {"kind": "empty"}
|
128
|
+
|
129
|
+
# Prepare optional preamble for narrative outputs
|
130
|
+
heading = get_output_format_set_heading(format_set_name)
|
131
|
+
desc = get_output_format_set_description(format_set_name)
|
132
|
+
preamble = f"# {heading}\n{desc}\n\n" if heading and desc else ""
|
133
|
+
|
134
|
+
if output_format in {"DICT", "JSON", "ALL"}:
|
135
|
+
# Return raw data (list/dict/any) — do not stringify here
|
136
|
+
return {"kind": "json", "data": result}
|
137
|
+
elif output_format in {"REPORT", "MERMAID"}:
|
138
|
+
content = result
|
139
|
+
if isinstance(result, (list, dict)):
|
140
|
+
# Make a simple JSON code block if the source returned structured data unexpectedly
|
141
|
+
content = preamble + "```json\n" + json.dumps(result, indent=2) + "\n```"
|
142
|
+
else:
|
143
|
+
content = preamble + str(result)
|
144
|
+
return {"kind": "text", "mime": "text/markdown", "content": content}
|
145
|
+
elif output_format == "HTML":
|
146
|
+
content = str(result)
|
147
|
+
return {"kind": "text", "mime": "text/html", "content": content}
|
148
|
+
else:
|
149
|
+
# Unknown or table-like formats which aren't appropriate for MCP by default
|
150
|
+
return {"kind": "unknown", "raw": result}
|
151
|
+
|
152
|
+
except PyegeriaException as e:
|
153
|
+
# Re-raise with a simpler message for upstream mapping
|
154
|
+
raise
|
155
|
+
finally:
|
156
|
+
try:
|
157
|
+
client.close_session()
|
158
|
+
except Exception:
|
159
|
+
pass
|
pyegeria/mcp_adapter.py
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
"""
|
2
|
+
SPDX-License-Identifier: Apache-2.0
|
3
|
+
|
4
|
+
Thin adapter helpers to surface pyegeria FormatSets as MCP-style tools without
|
5
|
+
side effects. This does NOT implement an MCP transport/server; it focuses on
|
6
|
+
programmatic functions that an MCP server entry point can call.
|
7
|
+
|
8
|
+
Only format sets that advertise DICT or ALL are considered eligible.
|
9
|
+
"""
|
10
|
+
from __future__ import annotations
|
11
|
+
|
12
|
+
import json
|
13
|
+
import sys
|
14
|
+
import asyncio
|
15
|
+
|
16
|
+
from loguru import logger
|
17
|
+
from typing import Any, Dict, Optional
|
18
|
+
|
19
|
+
from loguru import logger
|
20
|
+
|
21
|
+
from pyegeria._output_formats import (
|
22
|
+
list_mcp_format_sets,
|
23
|
+
select_output_format_set,
|
24
|
+
get_output_format_type_match,
|
25
|
+
)
|
26
|
+
from pyegeria.format_set_executor import run_format_set_action_return
|
27
|
+
|
28
|
+
|
29
|
+
def list_reports() -> dict:
|
30
|
+
"""List eligible format sets as MCP tools (support DICT or ALL)."""
|
31
|
+
return list_mcp_format_sets()
|
32
|
+
|
33
|
+
|
34
|
+
def describe_report(name: str, outputType: str = "DICT") -> Dict[str, Any]:
|
35
|
+
"""
|
36
|
+
Describe a format set for MCP discovery. If outputType != ANY, a concrete format
|
37
|
+
will be resolved; otherwise only metadata/action are returned.
|
38
|
+
"""
|
39
|
+
meta = select_output_format_set(name, outputType)
|
40
|
+
if not meta:
|
41
|
+
raise ValueError(f"Unknown or incompatible format set: {name}")
|
42
|
+
return meta
|
43
|
+
|
44
|
+
|
45
|
+
def _execute_egeria_call_blocking(
|
46
|
+
*,
|
47
|
+
report: str,
|
48
|
+
params: Optional[Dict[str, Any]] = None,
|
49
|
+
view_server: Optional[str] = None,
|
50
|
+
view_url: Optional[str] = None,
|
51
|
+
user: Optional[str] = None,
|
52
|
+
user_pass: Optional[str] = None,) -> Dict[str, Any]:
|
53
|
+
"""
|
54
|
+
Executes the synchronous, blocking Egeria client call on a dedicated worker thread.
|
55
|
+
|
56
|
+
You must replace the hardcoded return with your actual Egeria client logic here.
|
57
|
+
All code in this function runs in a blocking, synchronous manner.
|
58
|
+
"""
|
59
|
+
|
60
|
+
print(
|
61
|
+
f"Format set: {report}\nparams: {json.dumps(params)}\nview_server: {view_server}\nview_url: {view_url}\nuser: {user}\nuser_pass: {user_pass}",
|
62
|
+
file=sys.stderr)
|
63
|
+
# Lazy import of settings to avoid circulars when optional args are None
|
64
|
+
# from pyegeria.config import settings as _settings
|
65
|
+
from pyegeria.config import settings as _settings
|
66
|
+
|
67
|
+
|
68
|
+
return run_format_set_action_return(
|
69
|
+
format_set_name=report,
|
70
|
+
output_format="DICT",
|
71
|
+
params=params or {},
|
72
|
+
view_server=view_server if view_server is not None else _settings.Environment.egeria_view_server,
|
73
|
+
view_url=view_url if view_url is not None else _settings.Environment.egeria_view_server_url,
|
74
|
+
user=user if user is not None else _settings.User_Profile.user_name,
|
75
|
+
user_pass=user_pass if user_pass is not None else _settings.User_Profile.user_pwd,
|
76
|
+
)
|
77
|
+
# # Returning the hardcoded success for now to prove the async structure works.
|
78
|
+
# return {
|
79
|
+
# "status": "SUCCESS (Thread Test)",
|
80
|
+
# "report_name": report_name,
|
81
|
+
# "message": "The blocking call was successfully run on a separate thread, preventing timeout."
|
82
|
+
# }
|
83
|
+
|
84
|
+
|
85
|
+
def run_report(
|
86
|
+
*,
|
87
|
+
report: str,
|
88
|
+
params: Optional[Dict[str, Any]] = None,
|
89
|
+
view_server: Optional[str] = None,
|
90
|
+
view_url: Optional[str] = None,
|
91
|
+
user: Optional[str] = None,
|
92
|
+
user_pass: Optional[str] = None,
|
93
|
+
) -> Dict[str, Any]:
|
94
|
+
"""
|
95
|
+
Execute a format set action as an MCP-style tool. Enforces DICT/ALL by default.
|
96
|
+
Caller may pass credentials explicitly; otherwise defaults are used from config.
|
97
|
+
"""
|
98
|
+
print(f"Format set: {report}\nparams: {json.dumps(params)}\nview_server: {view_server}\nview_url: {view_url}\nuser: {user}\nuser_pass: {user_pass}", file=sys.stderr)
|
99
|
+
# Lazy import of settings to avoid circulars when optional args are None
|
100
|
+
from pyegeria.config import settings as _settings
|
101
|
+
logger.info(f"Format set: {formatSet}\nparams: {json.dumps(params)}\nview_server: {view_server}\nview_url: {view_url}\nuser: {user}\nuser_pass: {user_pass}")
|
102
|
+
return run_format_set_action_return(
|
103
|
+
format_set_name=report,
|
104
|
+
output_format="DICT",
|
105
|
+
params=params or {},
|
106
|
+
view_server=view_server if view_server is not None else _settings.Environment.egeria_view_server,
|
107
|
+
view_url=view_url if view_url is not None else _settings.Environment.egeria_view_server_url,
|
108
|
+
user=user if user is not None else _settings.User_Profile.user_name,
|
109
|
+
user_pass=user_pass if user_pass is not None else _settings.User_Profile.user_pwd,
|
110
|
+
)
|