pyegeria 5.4.0.2__py3-none-any.whl → 5.4.0.4__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.
@@ -13,7 +13,9 @@ import os
13
13
 
14
14
  import click
15
15
  from trogon import tui
16
+ from pyegeria import config_logging, get_app_config
16
17
 
18
+ from commands.cat.list_format_set import execute_format_set_action
17
19
  from commands.cat.dr_egeria_md import process_markdown_file
18
20
  from commands.cat.get_asset_graph import asset_viewer
19
21
  from commands.cat.get_collection import collection_viewer
@@ -58,110 +60,109 @@ from commands.my.todo_actions import (
58
60
  )
59
61
  from commands.tech.list_asset_types import display_asset_types
60
62
 
63
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
64
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
65
+ app_settings = get_app_config()
66
+ app_config = app_settings["Environment"]
67
+ # config_logging()
68
+
61
69
 
62
70
  # @tui
63
71
  # @tui('menu','menu','A textual object_action line interface')
64
72
  @tui()
65
- @click.version_option("0.0.1", prog_name="egeria_ops")
73
+ # @tui('menu', 'menu', 'A textual object_action line interface')
74
+ @click.version_option("5.4 ", prog_name="hey_egeria")
66
75
  @click.group()
67
76
  @click.option(
68
77
  "--server",
69
- default=os.environ.get("EGERIA_METADATA_STORE", "qs-metadata-store"),
78
+ default=app_config['Egeria Metadata Store'],
70
79
  help="Egeria metadata store to work with",
71
80
  )
72
81
  @click.option(
73
82
  "--url",
74
- default=os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443"),
83
+ default=app_config["Egeria Platform URL"],
75
84
  help="URL of Egeria metadata store platform to connect to",
76
85
  )
77
86
  @click.option(
78
87
  "--integration_daemon",
79
- default=os.environ.get("EGERIA_INTEGRATION_DAEMON", "qs-integration-daemon"),
88
+ default=app_config["Egeria Integration Daemon"],
80
89
  help="Egeria integration daemon to work with",
81
90
  )
82
91
  @click.option(
83
92
  "--integration_daemon_url",
84
- default=os.environ.get("EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"),
93
+ default=app_config['Egeria Integration Daemon URL'],
85
94
  help="URL of Egeria integration daemon platform to connect to",
86
95
  )
87
96
  @click.option(
88
97
  "--view_server",
89
- default=os.environ.get("EGERIA_VIEW_SERVER", "qs-view-server"),
98
+ default=app_config['Egeria View Server'],
90
99
  help="Egeria view server to work with",
91
100
  )
92
101
  @click.option(
93
102
  "--view_server_url",
94
- default=os.environ.get("EGERIA_VIEW_SERVER_URL", "https://localhost:9443"),
103
+ default=app_config['Egeria View Server URL'],
95
104
  help="URL of Egeria view server platform to connect to",
96
105
  )
97
106
  @click.option(
98
107
  "--engine_host",
99
- default=os.environ.get("EGERIA_ENGINE_HOST", "qs-engine-host"),
108
+ default=app_config['Egeria Engine Host'],
100
109
  help="Egeria engine host to work with",
101
110
  )
102
111
  @click.option(
103
112
  "--engine_host_url",
104
- default=os.environ.get("EGERIA_ENGINE_HOST_URL", "https://localhost:9443"),
113
+ default=app_config['Egeria Engine Host URL'],
105
114
  help="URL of Egeria engine host platform to connect to",
106
115
  )
107
- @click.option(
108
- "--admin_user",
109
- default=os.environ.get("EGERIA_ADMIN_USER", "garygeeke"),
110
- help="Egeria admin user",
111
- )
112
- @click.option(
113
- "--admin_user_password",
114
- default=os.environ.get("EGERIA_ADMIN_PASSWORD", "secret"),
115
- help="Egeria admin password",
116
- )
116
+
117
117
  @click.option(
118
118
  "--userid",
119
- default=os.environ.get("EGERIA_USER", "peterprofile"),
119
+ default=EGERIA_USER,
120
120
  help="Egeria user",
121
121
  )
122
122
  @click.option(
123
123
  "--password",
124
- default=os.environ.get("EGERIA_USER_PASSWORD", "secret"),
124
+ default=EGERIA_USER_PASSWORD,
125
125
  help="Egeria user password",
126
126
  )
127
127
  @click.option("--timeout", default=60, help="Number of seconds to wait")
128
128
  @click.option(
129
129
  "--jupyter",
130
130
  is_flag=True,
131
- default=os.environ.get("EGERIA_JUPYTER", "False"),
131
+ type=bool,
132
+ default=app_config['Egeria Jupyter'],
132
133
  help="Enable for rendering in a Jupyter terminal",
133
134
  )
134
135
  @click.option(
135
136
  "--width",
136
- default=os.environ.get("EGERIA_WIDTH", 200),
137
+ default=app_config['Console Width'],
137
138
  type=int,
138
139
  help="Screen width, in characters, to use",
139
140
  )
140
141
  @click.option(
141
142
  "--home_glossary_guid",
142
- default=os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None),
143
- help="Glossary guid to use as the home glossary",
143
+ default=app_settings['User Profile']['Egeria Home Glossary Name'],
144
+ help="Glossary name to use as the home glossary",
144
145
  )
145
146
  @click.option(
146
147
  "--glossary_path",
147
- default=os.environ.get("EGERIA_GLOSSARY_PATH", "/home/jovyan/loading-bay/glossary"),
148
+ default=app_config['Egeria Glossary Path'],
148
149
  help="Path to glossary import/export files",
149
150
  )
150
151
 
151
152
  @click.option(
152
153
  "--root_path",
153
- default=os.environ.get("EGERIA_ROOT_PATH", "/home/jovyan"),
154
+ default=app_config['Pyegeria Root'],
154
155
  help="Root path to use for file operations",
155
156
  )
156
157
 
157
158
  @click.option(
158
159
  "--inbox_path",
159
- default=os.environ.get("EGERIA_INBOX_PATH", "loading-bay/dr_egeria_inbox"),
160
+ default=app_config['Dr.Egeria Inbox'],
160
161
  help="Path to inbox files",
161
162
  )
162
163
  @click.option(
163
164
  "--outbox_path",
164
- default=os.environ.get("EGERIA_OUTBOX_PATH", "distribution-hub/dr_egeria_outbox"),
165
+ default=app_config['Dr.Egeria Outbox'],
165
166
  help="Path to outbox files",
166
167
  )
167
168
 
@@ -176,8 +177,6 @@ def cli(
176
177
  integration_daemon_url,
177
178
  engine_host,
178
179
  engine_host_url,
179
- admin_user,
180
- admin_user_password,
181
180
  userid,
182
181
  password,
183
182
  timeout,
@@ -199,8 +198,6 @@ def cli(
199
198
  integration_daemon_url,
200
199
  engine_host,
201
200
  engine_host_url,
202
- admin_user,
203
- admin_user_password,
204
201
  userid,
205
202
  password,
206
203
  timeout,
@@ -229,6 +226,22 @@ def info(ctx):
229
226
  pass
230
227
 
231
228
 
229
+ @info.command("list-output-set")
230
+ @click.option("--format-set", help="Format set to output")
231
+ @click.option("--output-format", default = "TABLE", help="Output format type")
232
+ @click.option('--search-string', default="*", help="Search string")
233
+ @click.pass_context
234
+ def show_format_set(ctx, format_set, output_format, search_string):
235
+ """Dynamically generate output based on a format set"""
236
+ c = ctx.obj
237
+
238
+ execute_format_set_action(
239
+ format_set, c.view_server, c.view_server_url,
240
+ c.userid, c.password, output_format, search_string = search_string
241
+ )
242
+
243
+
244
+
232
245
  @info.command("tech-types")
233
246
  @click.option("--tech_type", default="*", help="Tech type to search for")
234
247
  @click.pass_context
@@ -12,8 +12,6 @@ class Config(object):
12
12
  integration_daemon_url: str,
13
13
  engine_host: str,
14
14
  engine_host_url: str,
15
- admin_user: str,
16
- admin_user_password: str,
17
15
  userid: str,
18
16
  password: str,
19
17
  timeout: int,
@@ -33,8 +31,7 @@ class Config(object):
33
31
  self.integration_daemon_url = integration_daemon_url
34
32
  self.engine_host = engine_host
35
33
  self.engine_host_url = engine_host_url
36
- self.admin_user = admin_user
37
- self.admin_user_password = admin_user_password
34
+
38
35
  self.userid = userid
39
36
  self.password = password
40
37
  self.timeout = timeout
@@ -0,0 +1,8 @@
1
+ [
2
+ {
3
+ "Display Name": "",
4
+ "Qualified Name": " [DataStruct::TBDF-Incoming Weekly Measurement Data](#3e4bc9a1-2661-4d24-a753-b26060c61e34) ",
5
+ "Category": "",
6
+ "Description": "This describes the weekly measurement data for each patient for the Teddy Bear drop foot clinical trial."
7
+ }
8
+ ]
@@ -0,0 +1,19 @@
1
+ # Puddy Approves
2
+ This is a tutorial on how to use a data struct description
3
+
4
+ # Data Structure Report - created at 2025-07-29 15:54
5
+ Data Structure found from the search string: `All`
6
+
7
+ <a id="3e4bc9a1-2661-4d24-a753-b26060c61e34"></a>
8
+ # Data Structure Name:
9
+
10
+ ## Qualified Name
11
+ [DataStruct::TBDF-Incoming Weekly Measurement Data](#3e4bc9a1-2661-4d24-a753-b26060c61e34)
12
+
13
+ ## Description
14
+ This describes the weekly measurement data for each patient for the Teddy Bear drop foot clinical trial.
15
+
16
+ ## GUID
17
+ 3e4bc9a1-2661-4d24-a753-b26060c61e34
18
+
19
+ [[Data Structure]]
@@ -16,11 +16,9 @@ from rich.table import Table
16
16
  from rich.text import Text
17
17
  from rich import print, box
18
18
  from rich.console import Console
19
- from pyegeria.load_config import get_app_config
20
- from pyegeria._exceptions import EgeriaErrorCode
21
19
 
22
- app_settings = get_app_config()
23
- EGERIA_WIDTH = app_settings.get("console_width", 200)
20
+
21
+ EGERIA_WIDTH = os.getenv("PYEGERIA_CONSOLE_WIDTH", 200)
24
22
  console = Console(width=EGERIA_WIDTH)
25
23
 
26
24
  """
@@ -313,7 +311,7 @@ def print_exception_response(e: PyegeriaException):
313
311
  if isinstance(e, PyegeriaException):
314
312
  console.print(Markdown(f"\n---\n# Exception: {e.__class__.__name__}"))
315
313
  msg: Text = Text(e.__str__(), overflow="fold")
316
- if e.related_http_code:
314
+ if hasattr(e, 'related_http_code') and e.related_http_code:
317
315
  related_response = e.response.json()
318
316
  exception_msg_id = related_response.get("exceptionErrorMessageId", None)
319
317
  if exception_msg_id:
@@ -5,18 +5,24 @@ Copyright Contributors to the ODPi Egeria project.
5
5
 
6
6
  """
7
7
  # Purpose
8
+ This file manages output format sets.
9
+
8
10
  pyegeria allows find and get requests to generate output in different output formats -
9
11
  including DICT, MD, FORM, REPORT, LIST, MERMAID, TABLE, and perhaps additional ones in the future.
10
12
 
11
- Some of the formats, such as REPORT and LIST, allow the user to filter which attributes to
13
+ Some of the formats, such as REPORT and LIST, allow the user to filter which attributes to
12
14
  display, and the order in which they appear. However, many, if not most users will likely not want to customize
13
15
  the column list and so we need a sensible set of defaults for each type of output. These defaults are used
14
16
  by the find and get methods if the user doesn't provide a value for the columns parameter.
15
17
 
16
- This file contains these defaults and a function to return the the right default dict for a given type.
17
-
18
+ This file contains these defaults and a function to return the right default dict for a given type.
18
19
  """
19
20
 
21
+ from loguru import logger
22
+
23
+ # Constants
24
+ MD_SEPARATOR = "\n---\n\n"
25
+
20
26
  # Define shared elements
21
27
  COMMON_COLUMNS = [
22
28
  {'name': 'Display Name', 'key': 'display_name'},
@@ -49,6 +55,11 @@ COLLECTION_DICT = {
49
55
  "columns": COLLECTIONS_COLUMNS,
50
56
  }
51
57
 
58
+ COLLECTION_TABLE = {
59
+ "types": ["TABLE"],
60
+ "columns": COMMON_COLUMNS,
61
+ }
62
+
52
63
  COMMON_ANNOTATIONS = {
53
64
  "wikilinks": ["[[Commons]]"]
54
65
  }
@@ -85,7 +96,11 @@ output_format_sets = {
85
96
  "aliases": ["Collection", "RootCollection", "Folder", "ReferenceList", "HomeCollection",
86
97
  "ResultSet", "RecentAccess", "WorkItemList", "Namespace"],
87
98
  "annotations": COMMON_ANNOTATIONS,
88
- "formats": [COMMON_FORMATS_ALL, COLLECTION_DICT] # Reusing common formats
99
+ "formats": [COMMON_FORMATS_ALL, COLLECTION_DICT, COLLECTION_TABLE], # Reusing common formats
100
+ "action": [{"function": "CollectionManager.find_collections",
101
+ "user_params": [ "search_string"],
102
+ "spec_params": { },
103
+ }]
89
104
  },
90
105
 
91
106
  "DigitalProducts": {
@@ -107,6 +122,11 @@ output_format_sets = {
107
122
  {'name': 'Members', 'key': 'members', 'format': True},
108
123
  ],
109
124
  }
125
+ ],
126
+ "action": [{"function": "CollectionManager.find_collections",
127
+ "user_params": [ "search_string"],
128
+ "spec_params": { "classification_name":"DigitalProducts"}
129
+ }
110
130
  ]
111
131
  },
112
132
 
@@ -115,30 +135,63 @@ output_format_sets = {
115
135
  "description": "Attributes generic to all Agreements.",
116
136
  "aliases": ["DataSharingAgreement"],
117
137
  "annotations": {"wikilinks": ["[[Agreements]]", "[[Egeria]]"]},
118
- "formats": COMMON_FORMATS_ALL # Reusing common formats and columns
138
+ "formats": [COMMON_FORMATS_ALL] # Reusing common formats and columns
119
139
  },
120
140
 
121
- "Data Dictionary": {
141
+ "DataDictionary": {
122
142
  "heading": "Data Dictionary Information",
123
143
  "description": "Attributes useful to Data Dictionary.",
124
- "aliases": ["Data Dict"],
144
+ "aliases": ["Data Dict", "Data Dictionary"],
125
145
  "annotations": {"wikilinks": ["[[Data Dictionary]]"]},
126
- "formats": COMMON_FORMATS_ALL # Reusing common formats and columns
146
+ "formats": [COMMON_FORMATS_ALL], # Reusing common formats and columns
147
+ "action": [{"function": "CollectionManager.find_collections",
148
+ "user_params": [ "search_string"],
149
+ "spec_params": { "classification_name": "DataDictionary" },
150
+ }]
127
151
  },
128
152
 
129
153
  "Data Specification": {
130
154
  "heading": "Data Specification Information",
131
155
  "description": "Attributes useful to Data Specification.",
132
- "aliases": ["Data Spec"],
156
+ "aliases": ["Data Spec", "DataSpec", "DataSpecification"],
133
157
  "annotations": {"wikilinks": ["[[Data Specification]]"]},
134
- "formats": COMMON_FORMATS_ALL # Reusing common formats and columns
158
+ "formats": [{"types": ["TABLE"], "columns": COMMON_COLUMNS,}], # Reusing common formats and columns
159
+ "action": [{"function": "CollectionManager.find_collections",
160
+ "user_params": [ "search_string"],
161
+ "spec_params": { "classification_name": "DataSpec" },
162
+ }]
163
+ },
164
+ "DataStruct": {
165
+ "heading": "Data Structure Information",
166
+ "description": "Attributes useful to Data Structures.",
167
+ "aliases": ["Data Structure", "DataStructures", "Data Structures", "Data Struct", "DataStructure"],
168
+ "annotations": {"wikilinks": ["[[Data Structure]]"]},
169
+ "formats": [{"types": ["ALL"], "columns" : COMMON_COLUMNS}], # Reusing common formats and columns
170
+ "action": [{"function": "DataDesigner.find_data_structures",
171
+ "user_params": ["search_string" ],
172
+ "spec_params": { },
173
+ }]
135
174
  },
175
+ "Mandy-DataStruct": {
176
+ "heading": "Puddy Approves",
177
+ "description": "This is a tutorial on how to use a data struct description",
178
+ "aliases": [],
179
+ "annotations": {"wikilinks": ["[[Data Structure]]"]},
180
+ "formats": [{"types": ["TABLE"], "columns": COMMON_COLUMNS + [{'name': 'GUID', 'key': 'GUID'}]},
181
+ { "types": ["DICT", "LIST", "REPORT"], "columns": COMMON_COLUMNS + [{'name': 'GUID', 'key': 'GUID'}]}
182
+ ],
183
+ "action": [{
184
+ "function": "DataDesigner.find_data_structures",
185
+ "user_params": ["filter"],
186
+ "spec_params": {},
187
+ }]
188
+ },
136
189
  }
137
190
 
138
-
139
191
  def select_output_format_set(kind: str, output_type: str) -> dict | None:
140
192
  """
141
193
  This function retrieves the appropriate output set configuration dictionary based on the `kind` and `output_type`.
194
+ If output_type = `ANY` that indicates this is just a test to see of the output format set exists.
142
195
 
143
196
  :param kind: The kind of output set (e.g., "Referenceable", "Collections").
144
197
  :param output_type: The desired output format type (e.g., "DICT", "LIST", "REPORT").
@@ -147,17 +200,14 @@ def select_output_format_set(kind: str, output_type: str) -> dict | None:
147
200
  Returns:
148
201
  dict | None:
149
202
  """
150
- from loguru import logger
151
- # from pyegeria.logging_configuration import config_logging
152
-
153
- # config_logging()
154
-
155
203
  # Normalize the output type to uppercase for consistency
204
+ output_sets = output_format_sets
205
+
156
206
  output_type = output_type.upper()
157
207
  output_struct:dict = {}
158
208
 
159
209
  # Step 1: Check if `kind` exists in the `output_format_sets` dictionary
160
- element = output_format_sets.get(kind)
210
+ element = output_sets.get(kind)
161
211
 
162
212
  # Step 2: If not found, attempt to match `kind` in aliases
163
213
  if element is None:
@@ -170,7 +220,7 @@ def select_output_format_set(kind: str, output_type: str) -> dict | None:
170
220
 
171
221
  # Step 3: If still not found, return None
172
222
  if element is None:
173
- msg = "No matching column set found for kind='{kind}' and output type='{output_type}'."
223
+ msg = f"No matching column set found for kind='{kind}' and output type='{output_type}'."
174
224
  logger.error(msg)
175
225
  return None
176
226
  else:
@@ -178,6 +228,12 @@ def select_output_format_set(kind: str, output_type: str) -> dict | None:
178
228
  output_struct["heading"] = element.get("heading", [])
179
229
  output_struct["description"] = element.get("description", [])
180
230
  output_struct["annotations"] = element.get("annotations", {})
231
+ if "action" in element:
232
+ output_struct["action"] = element.get("action", [])
233
+
234
+ # If this was just a validation that the format set could be found then the output type is ANY - so just return.
235
+ if output_type == "ANY":
236
+ return output_struct
181
237
 
182
238
  # Step 4: Search for a matching format in the `formats` list
183
239
  for format in element.get("formats", []):
@@ -193,4 +249,12 @@ def select_output_format_set(kind: str, output_type: str) -> dict | None:
193
249
 
194
250
  # Step 6: If no match is found, return None
195
251
  logger.error(f"No matching format found for kind='{kind}' with output type='{output_type}'.")
196
- return None
252
+ return None
253
+
254
+ def output_format_set_list()->list[str]:
255
+ return list(output_format_sets.keys())
256
+
257
+ def get_output_format_set_heading(format_set: str) -> str:
258
+ return output_format_sets[format_set].get("heading")
259
+ def get_output_format_set_description(format_set: str) -> str:
260
+ return output_format_sets[format_set].get("description")
@@ -11,7 +11,7 @@ from typing import Dict, Union, List, Optional
11
11
 
12
12
  from loguru import logger
13
13
 
14
- from pyegeria import select_output_format_set
14
+ from pyegeria._output_formats import select_output_format_set
15
15
  from pyegeria._client import Client
16
16
  from pyegeria._globals import NO_ELEMENTS_FOUND, NO_GUID_RETURNED, NO_MEMBERS_FOUND
17
17
  from pyegeria._validators import validate_guid, validate_search_string
@@ -11,9 +11,10 @@ import asyncio
11
11
  from os import terminal_size
12
12
 
13
13
  from httpx import Response
14
+ from loguru import logger
14
15
  from prompt_toolkit import data_structures
15
16
 
16
- from pyegeria import select_output_format_set
17
+ from pyegeria._output_formats import select_output_format_set
17
18
  from pyegeria._client import Client, max_paging_size
18
19
  from pyegeria._globals import NO_ELEMENTS_FOUND
19
20
  from pyegeria.output_formatter import (extract_mermaid_only, extract_basic_dict, generate_output,
@@ -1328,15 +1329,15 @@ r replace_all_properties: bool, default = False
1328
1329
  output_format, columns_struct))
1329
1330
  return response
1330
1331
 
1331
- async def _async_find_data_structures(self, filter: str, start_from: int = 0, page_size: int = max_paging_size,
1332
+ async def _async_find_data_structures(self, search_string: str, start_from: int = 0, page_size: int = max_paging_size,
1332
1333
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
1333
- output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1334
+ output_format: str = 'JSON', output_format_set: str|dict = None) -> list | str:
1334
1335
  """ Find the list of data structure metadata elements that contain the search string.
1335
1336
  Async version.
1336
1337
 
1337
1338
  Parameters
1338
1339
  ----------
1339
- filter: str
1340
+ search_string: str
1340
1341
  - search string to filter on.
1341
1342
  start_from: int, default = 0
1342
1343
  - index of the list to start from (0 for start).
@@ -1350,7 +1351,7 @@ r replace_all_properties: bool, default = False
1350
1351
  - If True, the case of the search string is ignored.
1351
1352
  output_format: str, default = "DICT"
1352
1353
  - one of "DICT", "MERMAID" or "JSON"
1353
- columns_struct: dict, optional, default = None
1354
+ output_format_set: dict|str, optional, default = None
1354
1355
  - The desired output columns/field options.
1355
1356
  Returns
1356
1357
  -------
@@ -1367,10 +1368,10 @@ r replace_all_properties: bool, default = False
1367
1368
  the requesting user is not authorized to issue this request.
1368
1369
 
1369
1370
  """
1370
- if filter == "*":
1371
- filter = None
1371
+ if search_string == "*":
1372
+ search_string = None
1372
1373
 
1373
- body = {"filter": filter}
1374
+ body = {"filter": search_string}
1374
1375
  starts_with_s = str(starts_with).lower()
1375
1376
  ends_with_s = str(ends_with).lower()
1376
1377
  ignore_case_s = str(ignore_case).lower()
@@ -1379,8 +1380,6 @@ r replace_all_properties: bool, default = False
1379
1380
  [("startFrom", start_from), ("pageSize", page_size), ("startsWith", ends_with_s), ("endsWith", ends_with_s),
1380
1381
  ("ignoreCase", ignore_case_s),])
1381
1382
 
1382
-
1383
-
1384
1383
  url = (f"{base_path(self, self.view_server)}/data-structures/by-search-string"
1385
1384
  f"{possible_query_params}")
1386
1385
 
@@ -1391,17 +1390,17 @@ r replace_all_properties: bool, default = False
1391
1390
  return NO_ELEMENTS_FOUND
1392
1391
 
1393
1392
  if output_format != 'JSON': # return a simplified markdown representation
1394
- return self._generate_data_structure_output(elements, filter, output_format, columns_struct)
1393
+ return self._generate_data_structure_output(elements, filter, output_format, output_format_set)
1395
1394
  return elements
1396
1395
 
1397
- def find_data_structures(self, filter: str, start_from: int = 0, page_size: int = max_paging_size,
1396
+ def find_data_structures(self, search_string: str, start_from: int = 0, page_size: int = max_paging_size,
1398
1397
  starts_with: bool = True, ends_with: bool = False, ignore_case: bool = True,
1399
- output_format: str = 'JSON', columns_struct: dict = None) -> list | str:
1398
+ output_format: str = 'JSON', output_format_set:str| dict = None) -> list | str:
1400
1399
  """ Retrieve the list of data structure metadata elements that contain the search string filter.
1401
1400
 
1402
1401
  Parameters
1403
1402
  ----------
1404
- filter: str
1403
+ search_string: str
1405
1404
  - search string to filter on.
1406
1405
  start_from: int, default = 0
1407
1406
  - index of the list to start from (0 for start).
@@ -1416,7 +1415,7 @@ r replace_all_properties: bool, default = False
1416
1415
  output_format: str, default = "DICT"
1417
1416
  output_format: str, default = "DICT"
1418
1417
  - one of "DICT", "MERMAID" or "JSON"
1419
- columns_struct: dict, optional, default = None
1418
+ output_format_set: dict|str, optional, default = None
1420
1419
  - The desired output columns/field options.
1421
1420
 
1422
1421
  Returns
@@ -1438,8 +1437,8 @@ r replace_all_properties: bool, default = False
1438
1437
 
1439
1438
  loop = asyncio.get_event_loop()
1440
1439
  response = loop.run_until_complete(
1441
- self._async_find_data_structures(filter, start_from, page_size, starts_with, ends_with, ignore_case,
1442
- output_format, columns_struct))
1440
+ self._async_find_data_structures(search_string, start_from, page_size, starts_with, ends_with, ignore_case,
1441
+ output_format, output_format_set))
1443
1442
  return response
1444
1443
 
1445
1444
  async def _async_get_data_structures_by_name(self, filter: str, body: dict = None, start_from: int = 0,
@@ -5381,7 +5380,7 @@ r replace_all_properties: bool, default = False
5381
5380
  )
5382
5381
 
5383
5382
 
5384
- def _generate_data_structure_output(self, elements, filter, output_format, columns_struct) -> str | list:
5383
+ def _generate_data_structure_output(self, elements, filter, output_format: str = "DICT", output_format_set: str|dict = None) -> str | list:
5385
5384
  """
5386
5385
  Generate output for data structures in the specified format.
5387
5386
 
@@ -5394,17 +5393,24 @@ r replace_all_properties: bool, default = False
5394
5393
  Formatted output as string or list of dictionaries
5395
5394
  """
5396
5395
  entity_type = "Data Structure"
5397
- if columns_struct is None:
5398
- columns_struct = select_output_format_set(entity_type, output_format)
5399
-
5400
-
5396
+ if output_format_set is None:
5397
+ output_format_set = select_output_format_set(entity_type, output_format)
5398
+
5399
+ if output_format_set:
5400
+ if isinstance(output_format_set, str):
5401
+ output_formats = select_output_format_set(output_format_set, output_format)
5402
+ if isinstance(output_format_set, dict):
5403
+ output_formats = output_format_set
5404
+ else:
5405
+ output_formats = None
5406
+ logger.trace(f"Executing generate_data_structure_output for {entity_type}: {output_formats}")
5401
5407
  return generate_output(elements,
5402
5408
  filter,
5403
5409
  entity_type,
5404
5410
  output_format,
5405
5411
  self._extract_data_structure_properties,
5406
5412
  None,
5407
- columns_struct,
5413
+ output_formats,
5408
5414
  )
5409
5415
 
5410
5416
  def _generate_data_class_output(self, elements: dict, filter: str, output_format: str, columns_struct: dict = None) -> str | list: