pyegeria 5.4.0.dev14__py3-none-any.whl → 5.4.0.2__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.
Files changed (43) hide show
  1. commands/cat/__init__.py +1 -17
  2. commands/cat/dr_egeria_md.py +6 -4
  3. commands/cat/list_collections.py +46 -36
  4. md_processing/__init__.py +5 -2
  5. md_processing/data/commands-working.json +34850 -0
  6. md_processing/data/commands.json +1750 -530
  7. md_processing/md_commands/product_manager_commands.py +171 -220
  8. md_processing/md_processing_utils/common_md_proc_utils.py +9 -0
  9. md_processing/md_processing_utils/common_md_utils.py +15 -2
  10. md_processing/md_processing_utils/md_processing_constants.py +44 -6
  11. pyegeria/__init__.py +8 -4
  12. pyegeria/_client.py +2 -1
  13. pyegeria/_client_new.py +688 -0
  14. pyegeria/_exceptions_new.py +364 -0
  15. pyegeria/_globals.py +3 -1
  16. pyegeria/_output_formats.py +196 -0
  17. pyegeria/_validators.py +72 -199
  18. pyegeria/collection_manager_omvs.py +602 -324
  19. pyegeria/data_designer_omvs.py +251 -203
  20. pyegeria/load_config.py +206 -0
  21. pyegeria/logging_configuration.py +204 -0
  22. pyegeria/output_formatter.py +162 -31
  23. pyegeria/utils.py +99 -61
  24. {pyegeria-5.4.0.dev14.dist-info → pyegeria-5.4.0.2.dist-info}/METADATA +4 -1
  25. {pyegeria-5.4.0.dev14.dist-info → pyegeria-5.4.0.2.dist-info}/RECORD +28 -37
  26. commands/cat/debug_log +0 -2806
  27. commands/cat/debug_log.2025-07-15_14-28-38_087378.zip +0 -0
  28. commands/cat/debug_log.2025-07-16_15-48-50_037087.zip +0 -0
  29. md_processing/dr_egeria_outbox-pycharm/.obsidian/app.json +0 -1
  30. md_processing/dr_egeria_outbox-pycharm/.obsidian/appearance.json +0 -1
  31. md_processing/dr_egeria_outbox-pycharm/.obsidian/core-plugins.json +0 -31
  32. md_processing/dr_egeria_outbox-pycharm/.obsidian/workspace.json +0 -177
  33. md_processing/dr_egeria_outbox-pycharm/monday/processed-2025-07-14 12:38-data_designer_out.md +0 -663
  34. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 15:00-Derive-Dr-Gov-Defs.md +0 -719
  35. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:13-Derive-Dr-Gov-Defs.md +0 -41
  36. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:14-Derive-Dr-Gov-Defs.md +0 -33
  37. md_processing/dr_egeria_outbox-pycharm/thursday/processed-2025-07-17 20:50-Derive-Dr-Gov-Defs.md +0 -192
  38. md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-16 19:15-gov_def2.md +0 -527
  39. md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-17 12:08-gov_def2.md +0 -527
  40. md_processing/dr_egeria_outbox-pycharm/tuesday/processed-2025-07-17 14:27-gov_def2.md +0 -474
  41. {pyegeria-5.4.0.dev14.dist-info → pyegeria-5.4.0.2.dist-info}/LICENSE +0 -0
  42. {pyegeria-5.4.0.dev14.dist-info → pyegeria-5.4.0.2.dist-info}/WHEEL +0 -0
  43. {pyegeria-5.4.0.dev14.dist-info → pyegeria-5.4.0.2.dist-info}/entry_points.txt +0 -0
commands/cat/__init__.py CHANGED
@@ -2,22 +2,6 @@
2
2
  SPDX-License-Identifier: Apache-2.0
3
3
  Copyright Contributors to the ODPi Egeria project.
4
4
  """
5
- from pyegeria import (
6
- INTEGRATION_GUIDS,
7
- TEMPLATE_GUIDS,
8
- default_time_out,
9
- disable_ssl_warnings,
10
- enable_ssl_check,
11
- is_debug,
12
- max_paging_size,
13
- NO_ELEMENTS_FOUND,
14
- NO_ASSETS_FOUND,
15
- NO_SERVERS_FOUND,
16
- NO_CATALOGS_FOUND,
17
- NO_GLOSSARIES_FOUND,
18
- NO_TERMS_FOUND,
19
- NO_CATEGORIES_FOUND,
20
- NO_ELEMENT_FOUND,
21
- )
5
+
22
6
 
23
7
 
@@ -28,9 +28,10 @@ from md_processing import (extract_command, process_glossary_upsert_command, pro
28
28
  process_information_supply_chain_upsert_command,
29
29
  process_information_supply_chain_link_unlink_command, process_sol_arch_list_command,
30
30
  process_digital_product_upsert_command, process_agreement_upsert_command,
31
+ process_collection_list_command, process_collection_upsert_command, process_link_agreement_item_command,
31
32
  process_gov_definition_upsert_command, GOV_COM_LIST, GOV_LINK_LIST,
32
33
  process_gov_def_link_detach_command, process_gov_definition_list_command,
33
- process_gov_def_context_command)
34
+ process_gov_def_context_command, COLLECTIONS_LIST, SIMPLE_COLLECTIONS)
34
35
  from md_processing.md_commands.data_designer_commands import (process_data_spec_upsert_command,
35
36
  process_data_dict_upsert_command,
36
37
  process_data_collection_list_command,
@@ -190,14 +191,15 @@ def process_markdown_file(input_file: str, output_folder:str, directive: str, se
190
191
  result = process_digital_product_upsert_command(client, current_block, directive)
191
192
  elif potential_command in ["Create Agreement", "Create Data Sharing Agreement", "Update Agreement", "Update Data Sharing Agreement"]:
192
193
  result = process_agreement_upsert_command(client, current_block, directive)
194
+ elif potential_command in SIMPLE_COLLECTIONS:
195
+ result = process_collection_upsert_command(client, current_block, directive)
193
196
  elif potential_command in GOV_COM_LIST:
194
197
  result = process_gov_definition_upsert_command(client, current_block, directive)
195
198
  elif potential_command in ['View Governance Definitions', 'List Governance Definitions',
196
199
  'View Gov Definitions', 'List Gov Definitions']:
197
200
  result = process_gov_definition_list_command(client, current_block, directive)
198
- elif potential_command in ['View Governance Definition Context', 'List Governance Definition Context',
199
- 'View Gov Definition Context', 'List Gov Definition Context']:
200
- result = process_gov_def_context_command(client, current_block, directive)
201
+ elif potential_command in COLLECTIONS_LIST:
202
+ result = process_collection_list_command(client, current_block, directive)
201
203
 
202
204
 
203
205
 
@@ -18,43 +18,50 @@ from rich.table import Table
18
18
  from rich.text import Text
19
19
 
20
20
  from pyegeria import (
21
- EgeriaTech,
22
- InvalidParameterException,
23
- PropertyServerException,
24
- UserNotAuthorizedException,
25
- print_exception_response, NO_ELEMENTS_FOUND,
21
+ # EgeriaTech,
22
+ # InvalidParameterException,
23
+ # PropertyServerException,
24
+ # UserNotAuthorizedException,
25
+ CollectionManager,
26
+ NO_ELEMENTS_FOUND,config_logging, get_app_config
26
27
  )
28
+ from pyegeria._exceptions_new import PyegeriaException, print_exception_response
27
29
 
28
- disable_ssl_warnings = True
29
-
30
- EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
31
- EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
32
- EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
33
- EGERIA_VIEW_SERVER = os.environ.get("EGERIA_VIEW_SERVER", "view-server")
34
- EGERIA_VIEW_SERVER_URL = os.environ.get(
35
- "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
36
- )
37
- EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon")
38
- EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
39
- EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
30
+
31
+
32
+ # disable_ssl_warnings = True
33
+
34
+ # EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
35
+ # EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
36
+ # EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
37
+ # EGERIA_VIEW_SERVER = os.environ.get("EGERIA_VIEW_SERVER", "view-server")
38
+ # EGERIA_VIEW_SERVER_URL = os.environ.get(
39
+ # "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
40
+ # )
41
+ # EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon")
42
+ # EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
43
+ # EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
40
44
  EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
41
45
  EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
42
- EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
43
- EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
44
- EGERIA_GLOSSARY_PATH = os.environ.get("EGERIA_GLOSSARY_PATH", None)
45
- EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", "../../")
46
- EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "md_processing/dr_egeria_inbox")
47
- EGERIA_OUTBOX_PATH = os.environ.get("EGERIA_OUTBOX_PATH", "md_processing/dr_egeria_outbox")
46
+ # EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
47
+ # EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
48
+ # EGERIA_GLOSSARY_PATH = os.environ.get("EGERIA_GLOSSARY_PATH", None)
49
+ # EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", "../../")
50
+ # EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "md_processing/dr_egeria_inbox")
51
+ # EGERIA_OUTBOX_PATH = os.environ.get("EGERIA_OUTBOX_PATH", "md_processing/dr_egeria_outbox")
52
+ app_settings = get_app_config()
53
+ app_config = app_settings["Environment"]
54
+ config_logging()
48
55
 
49
56
 
50
57
  def display_collections(
51
58
  search_string: str = "*",
52
- view_server: str = EGERIA_VIEW_SERVER,
53
- view_url: str = EGERIA_VIEW_SERVER_URL,
59
+ view_server: str = app_config['Egeria View Server'],
60
+ view_url: str = app_config['Egeria View Server URL'],
54
61
  user: str = EGERIA_USER,
55
62
  user_pass: str = EGERIA_USER_PASSWORD,
56
- jupyter: bool = EGERIA_JUPYTER,
57
- width: int = EGERIA_WIDTH,
63
+ jupyter: bool = app_config['Egeria Jupyter'],
64
+ width: int = app_config['Console Width'],
58
65
  output_format: str = "TABLE"
59
66
  ):
60
67
  """Display either a specified glossary or all collections if the search_string is '*'.
@@ -77,7 +84,7 @@ def display_collections(
77
84
  output_format : str, optional
78
85
  Format of the output. Default is TABLE.
79
86
  """
80
- m_client = EgeriaTech(view_server, view_url, user_id=user, user_pwd=user_pass)
87
+ m_client = CollectionManager(view_server, view_url, user_id=user, user_pwd=user_pass)
81
88
  m_client.create_egeria_bearer_token()
82
89
  try:
83
90
 
@@ -93,7 +100,7 @@ def display_collections(
93
100
  action = "List"
94
101
 
95
102
  if output_format != "TABLE":
96
- file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_OUTBOX_PATH)
103
+ file_path = os.path.join(app_config['Pyegeria Root'], app_config['Dr.Egeria Outbox'])
97
104
  if output_format == "HTML":
98
105
  file_name = f"Collections-{time.strftime('%Y-%m-%d-%H-%M-%S')}-{action}.html"
99
106
  else:
@@ -180,9 +187,7 @@ def display_collections(
180
187
  print("==> No collections with that name found")
181
188
 
182
189
  except (
183
- InvalidParameterException,
184
- UserNotAuthorizedException,
185
- PropertyServerException,
190
+ PyegeriaException
186
191
  ) as e:
187
192
  print_exception_response(e)
188
193
  finally:
@@ -197,23 +202,28 @@ def main():
197
202
  parser.add_argument("--password", help="User Password")
198
203
 
199
204
  args = parser.parse_args()
205
+ app_settings = get_app_config()
206
+ app_config = app_settings["Environment"]
200
207
 
201
- server = args.server if args.server is not None else EGERIA_VIEW_SERVER
202
- url = args.url if args.url is not None else EGERIA_PLATFORM_URL
208
+ server = args.server if args.server is not None else app_config['Egeria View Server']
209
+ url = args.url if args.url is not None else app_config['Egeria View Server URL']
203
210
  userid = args.userid if args.userid is not None else EGERIA_USER
204
211
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
205
212
 
206
213
  try:
207
214
  search_string = Prompt.ask(
208
- "Enter the collection you are searching for or '*' for all:", default="*"
215
+ "Enter the collection you are looking for or '*' for all:", default="*"
209
216
  ).strip()
210
- output_format = Prompt.ask("What output format do you want?", choices=["DICT", "TABLE", "FORM", "REPORT", "HTML", "LIST"], default="TABLE")
217
+ output_format = Prompt.ask("Which output format do you want?", choices=["DICT", "TABLE", "FORM", "REPORT", "HTML", "LIST"], default="TABLE")
211
218
 
212
219
  display_collections(search_string, server, url, userid, user_pass, output_format = output_format)
213
220
 
214
221
  except KeyboardInterrupt:
215
222
  pass
216
223
 
224
+ except PyegeriaException as e:
225
+ print_exception_response(e)
226
+
217
227
 
218
228
  if __name__ == "__main__":
219
229
  main()
md_processing/__init__.py CHANGED
@@ -8,7 +8,10 @@ from md_processing.md_commands.governance_officer_commands import (process_gov_d
8
8
 
9
9
 
10
10
  from md_processing.md_commands.product_manager_commands import (process_digital_product_upsert_command,
11
- process_agreement_upsert_command)
11
+ process_agreement_upsert_command,
12
+ process_collection_list_command,
13
+ process_collection_upsert_command,
14
+ process_link_agreement_item_command)
12
15
 
13
16
  from md_processing.md_commands.solution_architect_commands import (process_blueprint_upsert_command,
14
17
  process_solution_component_upsert_command,
@@ -63,7 +66,7 @@ from md_processing.md_processing_utils.md_processing_constants import (ALWAYS, E
63
66
  SEARCH_LABELS, GUID_LABELS,
64
67
  ELEMENT_OUTPUT_FORMATS, TERM_RELATIONSHPS,
65
68
  command_list, COMMAND_DEFINITIONS, GOV_COM_LIST,
66
- GOV_LINK_LIST)
69
+ GOV_LINK_LIST, COLLECTIONS_LIST, SIMPLE_COLLECTIONS,)
67
70
  # Import functions from md_processing_constants
68
71
  from md_processing.md_processing_utils.md_processing_constants import (load_commands, get_command_spec, get_attribute,
69
72
  get_attribute_labels, get_alternate_names)