pyegeria 1.5.1.1.3__py3-none-any.whl → 1.5.1.1.5__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.
@@ -8,6 +8,7 @@ Execute Glossary actions.
8
8
 
9
9
  """
10
10
  import csv
11
+ import json
11
12
  import os
12
13
  import sys
13
14
  import time
@@ -216,6 +217,12 @@ def create_term(
216
217
  @click.command("load-terms-from-file")
217
218
  @click.option("--glossary-name", help="Name of Glossary", required=True)
218
219
  @click.option("--file-name", help="Path of CSV file", required=True)
220
+ @click.option(
221
+ "--verbose",
222
+ type=bool,
223
+ default=False,
224
+ help="If true, result descriptions are provided",
225
+ )
219
226
  @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
220
227
  @click.option(
221
228
  "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
@@ -223,7 +230,9 @@ def create_term(
223
230
  @click.option("--userid", default=EGERIA_USER, help="Egeria user")
224
231
  @click.option("--password", default=EGERIA_USER_PASSWORD, help="Egeria user password")
225
232
  @click.option("--timeout", default=60, help="Number of seconds to wait")
226
- def load_terms(glossary_name, file_name, server, url, userid, password, timeout):
233
+ def load_terms(
234
+ glossary_name, file_name, verbose, server, url, userid, password, timeout
235
+ ):
227
236
  """Delete the glossary specified"""
228
237
  m_client = EgeriaTech(server, url, user_id=userid, user_pwd=password)
229
238
  token = m_client.create_egeria_bearer_token()
@@ -233,6 +242,8 @@ def load_terms(glossary_name, file_name, server, url, userid, password, timeout)
233
242
  click.echo(
234
243
  f"Loaded terms from into glossary: {glossary_name} from {file_name}"
235
244
  )
245
+ if verbose:
246
+ print(f"\n Verbose output:\n{json.dumps(result, indent = 2)}")
236
247
 
237
248
  except (InvalidParameterException, PropertyServerException) as e:
238
249
  print_exception_response(e)
@@ -64,6 +64,11 @@ class GlossaryManager(GlossaryBrowser):
64
64
  # Get Valid Values for Enumerations
65
65
  #
66
66
 
67
+ def __validate_term_status__(self, status: str) -> bool:
68
+ """Return True if the status is a legal glossary term status"""
69
+ recognized_term_status = {"DRAFT", "ACTIVE", "DEPRACATED", "OBSOLETE", "OTHER"}
70
+ return status in recognized_term_status
71
+
67
72
  async def _async_create_glossary(
68
73
  self,
69
74
  display_name: str,
@@ -1338,6 +1343,8 @@ class GlossaryManager(GlossaryBrowser):
1338
1343
  """
1339
1344
 
1340
1345
  validate_guid(glossary_guid)
1346
+ if self.__validate_term_status__(body["initialStatus"]) is False:
1347
+ raise InvalidParameterException("Bad status value")
1341
1348
 
1342
1349
  url = (
1343
1350
  f"{self.platform_url}/servers/{self.view_server}/api/open-metadata/glossary-manager/glossaries/"
@@ -1467,7 +1474,26 @@ class GlossaryManager(GlossaryBrowser):
1467
1474
 
1468
1475
  # process the row
1469
1476
  if term_name is None:
1477
+ term_info.append(
1478
+ {
1479
+ {"term_name": "---"},
1480
+ {"qualified_name": "---"},
1481
+ {"term_guid": "---"},
1482
+ {"error": "missing term names - skipping"},
1483
+ }
1484
+ )
1485
+ continue
1486
+ if self.__validate_term_status__(status) is False:
1487
+ term_info.append(
1488
+ {
1489
+ {"term_name": "---"},
1490
+ {"qualified_name": "---"},
1491
+ {"term_guid": "---"},
1492
+ {"error": "invalid term status"},
1493
+ }
1494
+ )
1470
1495
  continue
1496
+
1471
1497
  body = {
1472
1498
  "class": "ReferenceableRequestBody",
1473
1499
  "elementProperties": {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 1.5.1.1.3
3
+ Version: 1.5.1.1.5
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -6,7 +6,7 @@ commands/cat/get_project_dependencies.py,sha256=B0JaMSUi0hzVgos1sTY2uUPGy1DzKEJM
6
6
  commands/cat/get_project_structure.py,sha256=n2GbNd07w1DTo7jTR8b2ewXRyNcat_2BcCBRyDMldwk,5969
7
7
  commands/cat/get_tech_type_elements.py,sha256=-m3Q0BoNqkCtV8h75vMwTcOV-_ymEXmnJcr4Ec7WMAw,6180
8
8
  commands/cat/get_tech_type_template.py,sha256=gMFVcgCIm09GQu1Vsc5ZUVH9XLhItAG1eVGZJrcnHeQ,6174
9
- commands/cat/glossary_actions.py,sha256=tEQX85-hHIalEuKpgybx1V5_NeFDONNrOfrsb9VGlyE,8531
9
+ commands/cat/glossary_actions.py,sha256=KbSiMseXgQLdoT8TqXocl3WpE_gqalkxjxRuGZCzFw8,8775
10
10
  commands/cat/list_archives.py,sha256=FEZ2XYnQIWo2PztWqnj6unn0pbblPU0-bMbTyI3csv4,5464
11
11
  commands/cat/list_assets.py,sha256=bNwSaBDz661hfnc2Rn4j4HPHAugKvz0XwN9L1m4FVQk,6529
12
12
  commands/cat/list_cert_types.py,sha256=mbCls_EqC5JKG5rvS4o69k7KgZ6aNXlcqoJ3DtHsTFA,7127
@@ -92,7 +92,7 @@ pyegeria/egeria_tech_client.py,sha256=7NfqpJFft5GR4NPRDVDw22L9caHbXB8fhx0TAf6qEo
92
92
  pyegeria/feedback_manager_omvs.py,sha256=B66e3ZCaC_dirb0mcb2Nz3PYh2ZKsoMAYNOb3euNiro,152931
93
93
  pyegeria/full_omag_server_config.py,sha256=LBnqUiz1ofBdlKBzECFs_pQbdJwcWigAukWHGJRR2nU,47340
94
94
  pyegeria/glossary_browser_omvs.py,sha256=NcitYaZJqwVODBO5zBtWpXPNUJJ3DKzEbRaOFSAyUlg,93554
95
- pyegeria/glossary_manager_omvs.py,sha256=Ui3LXiI5kyYXpJ35sn2pI4gB5XoAOXEKr6fWsZlCZrI,115642
95
+ pyegeria/glossary_manager_omvs.py,sha256=Nnk0cnpU4zJodIgEs7sqLTldd0fF2gKcMt2FBgSlAPI,116815
96
96
  pyegeria/mermaid_utilities.py,sha256=GXiS-subb5nJcDqlThZWX2T8WspU1neFfhf4TxRoMh4,8344
97
97
  pyegeria/my_profile_omvs.py,sha256=DyECbUFEcgokrIbzdMMNljC3bqfqKGXAF2wZEpzvRYs,34666
98
98
  pyegeria/platform_services.py,sha256=CJIOYIFEbcIGwdWlApAQcXxZTsdrhFtpJcm4O3p7dG0,41646
@@ -104,8 +104,8 @@ pyegeria/template_manager_omvs.py,sha256=heqbKeum5hPCHap4r1RUZU8YB3QaQlxVNbq4GZi
104
104
  pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
105
105
  pyegeria/valid_metadata_omvs.py,sha256=tfCGXed5LLt59YA8uZNNtd9UJ-lRZfPU_uZxK31Yux0,65069
106
106
  pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
107
- pyegeria-1.5.1.1.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
108
- pyegeria-1.5.1.1.3.dist-info/METADATA,sha256=aGv9vPLyMB7LgQKWG4R44euJ36ekbdMOS0m1tXrxB8I,2997
109
- pyegeria-1.5.1.1.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
110
- pyegeria-1.5.1.1.3.dist-info/entry_points.txt,sha256=eQF0CAWVQlHftl85JzL0pWSaQ1eURJ6MeI1I78FvAgQ,4127
111
- pyegeria-1.5.1.1.3.dist-info/RECORD,,
107
+ pyegeria-1.5.1.1.5.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
108
+ pyegeria-1.5.1.1.5.dist-info/METADATA,sha256=9LOU2PLe7BudUMtaoJUVHmOKY4FG7KxIB6Ngzx5oIC0,2997
109
+ pyegeria-1.5.1.1.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
110
+ pyegeria-1.5.1.1.5.dist-info/entry_points.txt,sha256=eQF0CAWVQlHftl85JzL0pWSaQ1eURJ6MeI1I78FvAgQ,4127
111
+ pyegeria-1.5.1.1.5.dist-info/RECORD,,