pyegeria 5.2.0.7__py3-none-any.whl → 5.2.0.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,6 @@ from pyegeria import body_slimmer
16
16
 
17
17
  from pyegeria._client import Client, max_paging_size
18
18
  from pyegeria._globals import default_time_out
19
- from tests.test_classification_manager_omvs import element_guid
20
19
 
21
20
 
22
21
  def query_seperator(current_string):
@@ -209,6 +208,7 @@ class MetadataExplorer(Client):
209
208
  self,
210
209
  guid: str,
211
210
  effective_time: str = None,
211
+ as_of_time: str = None,
212
212
  for_lineage: bool = None,
213
213
  for_duplicate_processing: bool = None,
214
214
  ) -> dict | str:
@@ -221,6 +221,8 @@ class MetadataExplorer(Client):
221
221
  - unique identifier of the element to retrieve
222
222
  effective_time: str, default = None
223
223
  - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
224
+ as_of_time: str, default = None
225
+ - Query the element as of this time. If None, then use current time.
224
226
  for_lineage: bool, default is set by server
225
227
  - determines if elements classified as Memento should be returned - normally false
226
228
  for_duplicate_processing: bool, default is set by server
@@ -249,8 +251,9 @@ class MetadataExplorer(Client):
249
251
  )
250
252
 
251
253
  body = {
252
- "class": "EffectiveTimeRequestBody",
254
+ "class": "AnyTimeRequestBody",
253
255
  "effectiveTime": effective_time,
256
+ "asOfTime": as_of_time,
254
257
  }
255
258
 
256
259
  url = (
@@ -266,6 +269,7 @@ class MetadataExplorer(Client):
266
269
  self,
267
270
  guid: str,
268
271
  effective_time: str = None,
272
+ as_of_time: str = None,
269
273
  for_lineage: bool = None,
270
274
  for_duplicate_processing: bool = None,
271
275
  ) -> dict | str:
@@ -278,6 +282,8 @@ class MetadataExplorer(Client):
278
282
  - unique identifier of the element to retrieve
279
283
  effective_time: str, default = None
280
284
  - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
285
+ as_of_time: str, default = None
286
+ - Query the element as of this time. If None, then use current time.
281
287
  for_lineage: bool, default is set by server
282
288
  - determines if elements classified as Memento should be returned - normally false
283
289
  for_duplicate_processing: bool, default is set by server
@@ -306,6 +312,158 @@ class MetadataExplorer(Client):
306
312
  )
307
313
  return response
308
314
 
315
+ async def _async_get_metadata_element_graph(
316
+ self,
317
+ guid: str,
318
+ effective_time: str = None,
319
+ as_of_time: str = None,
320
+ for_lineage: bool = None,
321
+ for_duplicate_processing: bool = None,
322
+ ) -> dict | str:
323
+ """
324
+ Retrieve the metadata element and all of its anchored elements using its unique identifier. Async version.
325
+
326
+ Parameters
327
+ ----------
328
+ guid : str
329
+ - unique identifier of the element to retrieve
330
+ effective_time: str, default = None
331
+ - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
332
+ as_of_time: str, default = None
333
+ - Query the element as of this time. If None, then use current time.
334
+ for_lineage: bool, default is set by server
335
+ - determines if elements classified as Memento should be returned - normally false
336
+ for_duplicate_processing: bool, default is set by server
337
+ - Normally false. Set true when the caller is part of a deduplication function
338
+
339
+ Returns
340
+ -------
341
+ dict | str
342
+ If the element is found, a dict of the element details is returned. Otherwise the string "No element found".
343
+
344
+ Raises
345
+ ------
346
+ InvalidParameterException
347
+ one of the parameters is null or invalid or
348
+ PropertyServerException
349
+ There is a problem adding the element properties to the metadata repository or
350
+ UserNotAuthorizedException
351
+ the requesting user is not authorized to issue this request.
352
+ """
353
+
354
+ possible_query_params = query_string(
355
+ [
356
+ ("forLineage", for_lineage),
357
+ ("forDuplicateProcessing", for_duplicate_processing),
358
+ ]
359
+ )
360
+
361
+ body = {
362
+ "class": "AnyTimeRequestBody",
363
+ "effectiveTime": effective_time,
364
+ "asOfTime": as_of_time,
365
+ }
366
+
367
+ url = (
368
+ f"{base_path(self, self.view_server)}/metadata-elements/{guid}/with-anchored-elements"
369
+ f"{possible_query_params}"
370
+ )
371
+ response: Response = await self._async_make_request(
372
+ "POST", url, body_slimmer(body)
373
+ )
374
+ return response.json().get("elementGraph", "No elements found")
375
+
376
+ def get_metadata_element_graph(
377
+ self,
378
+ guid: str,
379
+ effective_time: str = None,
380
+ as_of_time: str = None,
381
+ for_lineage: bool = None,
382
+ for_duplicate_processing: bool = None,
383
+ ) -> dict | str:
384
+ """
385
+ Retrieve the metadata element using its unique identifier.
386
+
387
+ Parameters
388
+ ----------
389
+ guid : str
390
+ - unique identifier of the element to retrieve
391
+ effective_time: str, default = None
392
+ - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
393
+ as_of_time: str, default = None
394
+ - Query the element as of this time. If None, then use current time.
395
+ for_lineage: bool, default is set by server
396
+ - determines if elements classified as Memento should be returned - normally false
397
+ for_duplicate_processing: bool, default is set by server
398
+ - Normally false. Set true when the caller is part of a deduplication function
399
+
400
+ Returns
401
+ -------
402
+ dict | str
403
+ If the element is found, a dict of the element details is returned. Otherwise the string "No element found".
404
+
405
+ Raises
406
+ ------
407
+ InvalidParameterException
408
+ one of the parameters is null or invalid or
409
+ PropertyServerException
410
+ There is a problem adding the element properties to the metadata repository or
411
+ UserNotAuthorizedException
412
+ the requesting user is not authorized to issue this request.
413
+ """
414
+
415
+ loop = asyncio.get_event_loop()
416
+ response = loop.run_until_complete(
417
+ self._async_get_metadata_element_graph(
418
+ guid, effective_time, as_of_time, for_lineage, for_duplicate_processing
419
+ )
420
+ )
421
+ return response
422
+
423
+ def get_metadata_element_mermaid_graph(
424
+ self,
425
+ guid: str,
426
+ effective_time: str = None,
427
+ as_of_time: str = None,
428
+ for_lineage: bool = None,
429
+ for_duplicate_processing: bool = None,
430
+ ) -> dict | str:
431
+ """
432
+ Retrieve the metadata element using its unique identifier.
433
+
434
+ Parameters
435
+ ----------
436
+ guid : str
437
+ - unique identifier of the element to retrieve
438
+ effective_time: str, default = None
439
+ - Time format is "YYYY-MM-DDTHH:MM:SS" (ISO 8601)
440
+ as_of_time: str, default = None
441
+ - Query the element as of this time. If None, then use current time.
442
+ for_lineage: bool, default is set by server
443
+ - determines if elements classified as Memento should be returned - normally false
444
+ for_duplicate_processing: bool, default is set by server
445
+ - Normally false. Set true when the caller is part of a deduplication function
446
+
447
+ Returns
448
+ -------
449
+ dict | str
450
+ If the element is found, a dict of the element details is returned. Otherwise the string "No element found".
451
+
452
+ Raises
453
+ ------
454
+ InvalidParameterException
455
+ one of the parameters is null or invalid or
456
+ PropertyServerException
457
+ There is a problem adding the element properties to the metadata repository or
458
+ UserNotAuthorizedException
459
+ the requesting user is not authorized to issue this request.
460
+ """
461
+
462
+ response = self.get_metadata_element_graph(
463
+ guid, effective_time, as_of_time, for_lineage, for_duplicate_processing
464
+ )
465
+ return response.get("mermaidGraph", "No elements found")
466
+
309
467
  async def _async_get_metadata_element_by_unique_name(
310
468
  self,
311
469
  name: str,
@@ -1829,6 +1987,7 @@ class MetadataExplorer(Client):
1829
1987
  self,
1830
1988
  guid: str,
1831
1989
  effective_time: str = None,
1990
+ as_of_time: str = None,
1832
1991
  for_lineage: bool = None,
1833
1992
  for_duplicate_processing: bool = None,
1834
1993
  ) -> dict | str:
@@ -1869,8 +2028,9 @@ class MetadataExplorer(Client):
1869
2028
  )
1870
2029
 
1871
2030
  body = {
1872
- "class": "EffectiveTimeRequestBody",
2031
+ "class": "AnyTimeRequestBody",
1873
2032
  "effectiveTime": effective_time,
2033
+ "asOfTime": as_of_time,
1874
2034
  }
1875
2035
 
1876
2036
  url = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 5.2.0.7
3
+ Version: 5.2.0.9
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -173,7 +173,7 @@ pyegeria/full_omag_server_config.py,sha256=k3fUfopAFAE3OKkFR7zZPiki_FYj6j2xQ4oD2
173
173
  pyegeria/glossary_browser_omvs.py,sha256=NcitYaZJqwVODBO5zBtWpXPNUJJ3DKzEbRaOFSAyUlg,93554
174
174
  pyegeria/glossary_manager_omvs.py,sha256=SWgPGkRag5hOXYM-cpbWI6oW_DXUZBt4ePtmOP7ZYUc,128787
175
175
  pyegeria/mermaid_utilities.py,sha256=GXiS-subb5nJcDqlThZWX2T8WspU1neFfhf4TxRoMh4,8344
176
- pyegeria/metadata_explorer_omvs.py,sha256=gW9RNl5OOZge5CrCjHNlSSCVYidylcF4iIwueLF-Vhc,76181
176
+ pyegeria/metadata_explorer_omvs.py,sha256=519Im5lyO0JaFqAr1xxQcPJ3jYMtC8OYXmh4Gj6DBPs,82282
177
177
  pyegeria/my_profile_omvs.py,sha256=DyECbUFEcgokrIbzdMMNljC3bqfqKGXAF2wZEpzvRYs,34666
178
178
  pyegeria/platform_services.py,sha256=CJIOYIFEbcIGwdWlApAQcXxZTsdrhFtpJcm4O3p7dG0,41646
179
179
  pyegeria/project_manager_omvs.py,sha256=Y7Lyqh4jIujJrr_Ub7feo904FN_uz4R10T4hKhqE1Uw,67499
@@ -184,8 +184,8 @@ pyegeria/template_manager_omvs.py,sha256=heqbKeum5hPCHap4r1RUZU8YB3QaQlxVNbq4GZi
184
184
  pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
185
185
  pyegeria/valid_metadata_omvs.py,sha256=tfCGXed5LLt59YA8uZNNtd9UJ-lRZfPU_uZxK31Yux0,65069
186
186
  pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
187
- pyegeria-5.2.0.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
188
- pyegeria-5.2.0.7.dist-info/METADATA,sha256=idILXpl4tmI1A1vrlHbQ149zT3clApfPHmFo7NCG84E,2879
189
- pyegeria-5.2.0.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
190
- pyegeria-5.2.0.7.dist-info/entry_points.txt,sha256=JhYgb02izlV2wb7SIfCOMxeVISUd9YJvgDW1-kuHad4,5240
191
- pyegeria-5.2.0.7.dist-info/RECORD,,
187
+ pyegeria-5.2.0.9.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
188
+ pyegeria-5.2.0.9.dist-info/METADATA,sha256=CK5MUg-H1pbtTDLxSY95cpD8_R8gj8y9CcnwzZ-IjHc,2879
189
+ pyegeria-5.2.0.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
190
+ pyegeria-5.2.0.9.dist-info/entry_points.txt,sha256=JhYgb02izlV2wb7SIfCOMxeVISUd9YJvgDW1-kuHad4,5240
191
+ pyegeria-5.2.0.9.dist-info/RECORD,,