pyegeria 5.4.7.6__py3-none-any.whl → 5.4.7.8__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.

Potentially problematic release.


This version of pyegeria might be problematic. Click here for more details.

@@ -75,44 +75,35 @@ class AutomatedCuration(Client2):
75
75
  Extract properties from a technology type element and populate the provided columns_struct.
76
76
  Tolerant to missing fields.
77
77
  """
78
- # Populate direct properties first
79
- col_data = populate_columns_from_properties(element, columns_struct)
80
- columns_list = col_data.get("formats", {}).get("columns", [])
81
-
82
- # Referenceable header extraction (GUID, qualifiedName, displayName, etc.)
83
- header_props = _extract_referenceable_properties(element)
84
- for column in columns_list:
85
- key = column.get("key")
86
- if key in header_props:
87
- column["value"] = header_props.get(key)
88
- elif isinstance(key, str) and key.lower() == "guid":
89
- column["value"] = header_props.get("GUID")
78
+ # # Populate direct properties first
79
+ # col_data = populate_columns_from_properties(element, columns_struct)
80
+ # columns_list = col_data.get("formats", {}).get("columns", [])
81
+ #
82
+ # # Referenceable header extraction (GUID, qualifiedName, displayName, etc.)
83
+ # header_props = _extract_referenceable_properties(element)
84
+ # for column in columns_list:
85
+ # key = column.get("key")
86
+ # if key in header_props:
87
+ # column["value"] = header_props.get(key)
88
+ # elif isinstance(key, str) and key.lower() == "guid":
89
+ # column["value"] = header_props.get("GUID")
90
+ #
91
+ # # Try common category/type fields
92
+ # category = (
93
+ # element.get("properties", {}).get("category")
94
+ # or element.get("elementProperties", {}).get("category")
95
+ # or element.get("elementType", {}).get("typeName")
96
+ # or ""
97
+ # )
98
+ columns_list = columns_struct.get("formats", {}).get("columns", [])
99
+
100
+ guid = element.get('technologyTypeGUID',None)
101
+ qualified_name = element.get('qualifiedName',None)
102
+ display_name = element.get('displayName',None)
103
+ description = element.get('description',None)
104
+ catalog_templates = element.get('catalogTemplates',None)
105
+ external_references = element.get('externalReferences',None)
90
106
 
91
- # Try common category/type fields
92
- category = (
93
- element.get("properties", {}).get("category")
94
- or element.get("elementProperties", {}).get("category")
95
- or element.get("elementType", {}).get("typeName")
96
- or ""
97
- )
98
- for column in columns_list:
99
- if column.get("key") in ("category", "type_name"):
100
- column["value"] = category
101
-
102
- # Classification names if present
103
- class_names = []
104
- for c in (element.get("elementHeader", {}).get("classifications") or []):
105
- name = c.get("classificationName")
106
- if name:
107
- class_names.append(name)
108
- if class_names:
109
- for column in columns_list:
110
- if column.get("key") == "classifications":
111
- column["value"] = ", ".join(class_names)
112
- break
113
-
114
- # Relationship-driven fields (generic handling)
115
- col_data = get_required_relationships(element, col_data)
116
107
 
117
108
  # Mermaid graph support if present
118
109
  mermaid_val = element.get("mermaidGraph", "") or ""
@@ -120,8 +111,33 @@ class AutomatedCuration(Client2):
120
111
  if column.get("key") == "mermaid":
121
112
  column["value"] = mermaid_val
122
113
  break
123
-
124
- return col_data
114
+ elif column.get("key") == "catalog_template_specs":
115
+ specs = ""
116
+ for template in catalog_templates:
117
+ for placeholder in template['specification']['placeholderProperty']:
118
+ specs += (f"* Placeholder Property: {placeholder['placeholderPropertyName']}\n\t"
119
+ f"Type: {placeholder.get('dataType',"")}\n\t"
120
+ f"Description: {placeholder.get('description',"")}\n\t"
121
+ f"Required: {placeholder.get("required","")}\n\t"
122
+ f"Example: {placeholder.get("example","")}\n\n")
123
+ column["value"] = specs
124
+ elif column.get("key") == "catalog_templates":
125
+ column["value"] =catalog_templates
126
+ elif column.get("key") == "guid":
127
+ column["value"] = guid
128
+ elif column.get("key") == "qualified_name":
129
+ column["value"] = qualified_name
130
+ elif column.get("key") == "display_name":
131
+ column["value"] = display_name
132
+ elif column.get("key") == "description":
133
+ column["value"] = description
134
+ elif column.get("key") == "external_references":
135
+ column["value"] = external_references
136
+ elif column.get("key") == "ref_url":
137
+ column["value"] = external_references[0]['relatedElement']['properties'].get('url',"")
138
+
139
+ columns_struct["formats"]["columns"] = columns_list
140
+ return columns_struct
125
141
 
126
142
  def _generate_tech_type_output(
127
143
  self,
@@ -3306,7 +3322,7 @@ class AutomatedCuration(Client2):
3306
3322
  )
3307
3323
  return response
3308
3324
 
3309
- async def _async_get_technology_type_detail(self, type_name: str, template_only: bool = False,
3325
+ async def _async_get_technology_type_detail(self, type_name: str,
3310
3326
  body: dict | FilterRequestBody = None,
3311
3327
  output_format: str = "JSON",
3312
3328
  output_format_set: str | dict = "TechType") -> list | str:
@@ -3316,13 +3332,9 @@ class AutomatedCuration(Client2):
3316
3332
  ----------
3317
3333
  type_name : str
3318
3334
  The name of the technology type to retrieve detailed information for.
3319
- template_only : bool
3320
- If true, only the template information will be returned.
3321
3335
  body: dict | FilterRequestBody
3322
3336
  If provided, the information in the body supersedes the other parameters and allows more advanced requests.
3323
3337
 
3324
-
3325
-
3326
3338
  Returns
3327
3339
  -------
3328
3340
  list[dict] | str
@@ -3356,27 +3368,24 @@ class AutomatedCuration(Client2):
3356
3368
  # validate_name(type_name)
3357
3369
  url = str(HttpUrl(f"{self.curation_command_root}/technology-types/by-name"))
3358
3370
  if body is None:
3359
- classified_elements = ["Template"] if template_only else []
3360
3371
  body = {
3361
3372
  "class": "FilterRequestBody",
3362
- "filter": type_name,
3363
- "includeOnlyClassifiedElements": classified_elements,
3373
+ "filter": type_name
3364
3374
  }
3365
- response = await self._async_get_name_request(
3366
- url,
3367
- _type=self.TECH_TYPE_ENTITY_LABEL,
3368
- _gen_output=self._generate_tech_type_output,
3369
- filter_string=type_name,
3370
- classification_names=classified_elements if template_only else None,
3371
- start_from=0,
3372
- page_size=0,
3373
- output_format=output_format,
3374
- output_format_set=output_format_set,
3375
- body=body,
3376
- )
3377
- return response
3378
3375
 
3379
- def get_technology_type_detail(self, type_name: str, template_only: bool = False,
3376
+ response = await self._async_make_request("POST", url, body)
3377
+ element = response.json().get("element", NO_ELEMENTS_FOUND)
3378
+ if type(element) is str:
3379
+ logger.info(NO_ELEMENTS_FOUND)
3380
+ return NO_ELEMENTS_FOUND
3381
+
3382
+ if output_format != 'JSON': # return a simplified markdown representation
3383
+ logger.info(f"Found elements, output format: {output_format} and output_format_set: {output_format_set}")
3384
+ return self._generate_tech_type_output(element, type_name, "ValidMetadataValue",
3385
+ output_format, output_format_set)
3386
+ return element
3387
+
3388
+ def get_technology_type_detail(self, type_name: str,
3380
3389
  body: dict | FilterRequestBody = None,
3381
3390
  output_format: str = "JSON",
3382
3391
  output_format_set: str | dict = "TechType") -> list | str:
@@ -3386,13 +3395,9 @@ class AutomatedCuration(Client2):
3386
3395
  ----------
3387
3396
  type_name : str
3388
3397
  The name of the technology type to retrieve detailed information for.
3389
- template_only : bool
3390
- If true, only the template information will be returned.
3391
3398
  body: dict | FilterRequestBody
3392
3399
  If provided, the information in the body supersedes the other parameters and allows more advanced requests.
3393
3400
 
3394
-
3395
-
3396
3401
  Returns
3397
3402
  -------
3398
3403
  list[dict] | str
@@ -3425,7 +3430,7 @@ class AutomatedCuration(Client2):
3425
3430
 
3426
3431
  loop = asyncio.get_event_loop()
3427
3432
  response = loop.run_until_complete(
3428
- self._async_get_technology_type_detail(type_name, template_only=template_only, body=body,
3433
+ self._async_get_technology_type_detail(type_name, body=body,
3429
3434
  output_format=output_format,
3430
3435
  output_format_set=output_format_set)
3431
3436
  )
@@ -209,7 +209,7 @@ class CollectionManager(Client2):
209
209
 
210
210
  url = (f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/collection-manager/"
211
211
  f"metadata-elements/{parent_guid}/collections")
212
- return await self._async_get_name_request(url, body, output_format, output_format_set)
212
+
213
213
  response = await self._async_make_request("POST", url, body_slimmer(body))
214
214
  elements = response.json().get("elements", NO_ELEMENTS_FOUND)
215
215
  if type(elements) is str:
pyegeria/config.py CHANGED
@@ -133,9 +133,9 @@ class DebugConfig(BaseModel):
133
133
 
134
134
  class LoggingConfig(BaseModel):
135
135
  """Logging configuration settings"""
136
- console_filter_levels: List[str] = ["ERROR"]
137
- console_logging_enabled: List[str] = ["_client_new", "_exceptions_new", "collections_manager_omvs", "tests"]
138
- console_logging_level: str = "INFO"
136
+ console_filter_levels: List[str] = ["SUCCESS"]
137
+ console_logging_enabled: List[str] = ["_client_new", "_exceptions_new", "dr_egeria_md", "tests"]
138
+ console_logging_level: str = "ERROR"
139
139
  enable_logging: bool = False
140
140
  file_logging_level: str = "INFO"
141
141
  log_directory: str = "logs"
@@ -1403,7 +1403,7 @@ class ExternalReferences(Client2):
1403
1403
  The principle specified by the user_id does not have authorization for the requested action
1404
1404
  """
1405
1405
  url = str(HttpUrl(f"{self.command_root}/external-references/by-name"))
1406
- response = await self._async_get_name_request(url, _type="Collection",
1406
+ response = await self._async_get_name_request(url, _type="ExternalReference",
1407
1407
  _gen_output=self._generate_external_reference_output,
1408
1408
  filter_string=filter_string,
1409
1409
  classification_names=classification_names,