pyegeria 0.7.43__tar.gz → 0.7.45__tar.gz

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 (99) hide show
  1. {pyegeria-0.7.43 → pyegeria-0.7.45}/PKG-INFO +1 -1
  2. pyegeria-0.7.45/examples/widgets/cat/list_archives.py +162 -0
  3. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cli/egeria.py +11 -0
  4. pyegeria-0.7.45/examples/widgets/cli/egeria_cat.py +525 -0
  5. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/monitor_engine_activity_c.py +9 -7
  6. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/monitor_gov_eng_status.py +9 -5
  7. pyegeria-0.7.45/examples/widgets/tech/list_gov_processes.py +162 -0
  8. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyproject.toml +2 -1
  9. pyegeria-0.7.43/examples/widgets/cli/egeria_cat.py +0 -293
  10. {pyegeria-0.7.43 → pyegeria-0.7.45}/LICENSE +0 -0
  11. {pyegeria-0.7.43 → pyegeria-0.7.45}/README.md +0 -0
  12. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/doc_samples/Create_Collection_Sample.py +0 -0
  13. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
  14. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/README.md +0 -0
  15. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/__init__.py +0 -0
  16. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/get_asset_graph.py +0 -0
  17. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/get_collection.py +0 -0
  18. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/get_project_dependencies.py +0 -0
  19. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/get_project_structure.py +0 -0
  20. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/get_tech_type_elements.py +0 -0
  21. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/get_tech_type_template.py +0 -0
  22. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/list_assets.py +0 -0
  23. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/list_cert_types.py +0 -0
  24. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/list_glossary.py +0 -0
  25. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/list_projects.py +0 -0
  26. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/list_relationships.py +0 -0
  27. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/list_tech_types.py +0 -0
  28. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/list_todos.py +0 -0
  29. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cat/list_user_ids.py +0 -0
  30. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cli/__init__.py +0 -0
  31. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cli/egeria_my.py +0 -0
  32. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cli/egeria_ops.py +0 -0
  33. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cli/egeria_tech.py +0 -0
  34. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/cli/ops_config.py +0 -0
  35. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/my/README.md +0 -0
  36. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/my/__init__.py +0 -0
  37. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/my/list_my_profile.py +0 -0
  38. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/my/list_my_roles.py +0 -0
  39. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/my/monitor_my_todos.py +0 -0
  40. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/my/monitor_open_todos.py +0 -0
  41. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/my/my_profile_actions.py +0 -0
  42. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/my/todo_actions.py +0 -0
  43. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/README.md +0 -0
  44. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/__init__.py +0 -0
  45. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/engine_actions.py +0 -0
  46. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/integration_daemon_actions.py +0 -0
  47. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/list_catalog_targets.py +0 -0
  48. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/load_archive.py +0 -0
  49. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/monitor_asset_events.py +0 -0
  50. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/monitor_coco_status.py +0 -0
  51. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/monitor_engine_activity.py +0 -0
  52. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/monitor_integ_daemon_status.py +0 -0
  53. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/monitor_platform_status.py +0 -0
  54. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/monitor_server_list.py +0 -0
  55. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/monitor_server_status.py +0 -0
  56. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/refresh_integration_daemon.py +0 -0
  57. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/ops/restart_integration_daemon.py +0 -0
  58. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/README.md +0 -0
  59. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/__init__.py +0 -0
  60. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/get_element_info.py +0 -0
  61. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/get_guid_info.py +0 -0
  62. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/get_tech_details.py +0 -0
  63. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/list_asset_types.py +0 -0
  64. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/list_elements.py +0 -0
  65. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/list_elements_x.py +0 -0
  66. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/list_registered_services.py +0 -0
  67. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/list_related_specification.py +0 -0
  68. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/list_relationship_types.py +0 -0
  69. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/list_tech_templates.py +0 -0
  70. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/list_valid_metadata_values.py +0 -0
  71. {pyegeria-0.7.43 → pyegeria-0.7.45}/examples/widgets/tech/x_list_related_elements.py +0 -0
  72. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/Xloaded_resources_omvs.py +0 -0
  73. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/__init__.py +0 -0
  74. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/_client.py +0 -0
  75. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/_deprecated_gov_engine.py +0 -0
  76. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/_exceptions.py +0 -0
  77. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/_globals.py +0 -0
  78. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/_validators.py +0 -0
  79. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/action_author_omvs.py +0 -0
  80. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/asset_catalog_omvs.py +0 -0
  81. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/automated_curation_omvs.py +0 -0
  82. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/classification_manager_omvs.py +0 -0
  83. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/collection_manager_omvs.py +0 -0
  84. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/core_omag_server_config.py +0 -0
  85. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/create_tech_guid_lists.py +0 -0
  86. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/feedback_manager_omvs.py +0 -0
  87. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/full_omag_server_config.py +0 -0
  88. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/glossary_browser_omvs.py +0 -0
  89. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/glossary_manager_omvs.py +0 -0
  90. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/mermaid_utilities.py +0 -0
  91. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/my_profile_omvs.py +0 -0
  92. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/platform_services.py +0 -0
  93. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/project_manager_omvs.py +0 -0
  94. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/registered_info.py +0 -0
  95. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/runtime_manager_omvs.py +0 -0
  96. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/server_operations.py +0 -0
  97. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/tech_guids_31-08-2024 14:33.py +0 -0
  98. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/utils.py +0 -0
  99. {pyegeria-0.7.43 → pyegeria-0.7.45}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.7.43
3
+ Version: 0.7.45
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -0,0 +1,162 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SPDX-Lic
4
+ ense-Identifier: Apache-2.0
5
+ Copyright Contributors to the ODPi Egeria project.
6
+
7
+ Unit tests for the Utils helper functions using the Pytest framework.
8
+
9
+
10
+ A simple display for archives
11
+ """
12
+ import argparse
13
+ import json
14
+ import os
15
+ import time, datetime
16
+
17
+ from rich import box
18
+ from rich import print
19
+ from rich.console import Console
20
+ from rich.prompt import Prompt
21
+ from rich.table import Table
22
+
23
+ from pyegeria import (
24
+ InvalidParameterException,
25
+ PropertyServerException,
26
+ UserNotAuthorizedException,
27
+ print_exception_response,
28
+ )
29
+ from pyegeria import ProjectManager, ClassificationManager
30
+
31
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
32
+ EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
33
+ EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
34
+ EGERIA_VIEW_SERVER = os.environ.get("VIEW_SERVER", "view-server")
35
+ EGERIA_VIEW_SERVER_URL = os.environ.get(
36
+ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
37
+ )
38
+ EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
39
+ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
40
+ "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
41
+ )
42
+ EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
43
+ EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
44
+ EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
45
+ EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
46
+ EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
47
+ EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
48
+
49
+
50
+ def display_archive_list(
51
+ server: str,
52
+ url: str,
53
+ username: str,
54
+ user_pass: str,
55
+ save_output: bool,
56
+ jupyter: bool = EGERIA_JUPYTER,
57
+ width: int = EGERIA_WIDTH,
58
+ ):
59
+ c_client = ClassificationManager(server, url, user_id=username)
60
+ token = c_client.create_egeria_bearer_token(username, user_pass)
61
+
62
+ def generate_table() -> Table:
63
+ """Make a new table."""
64
+ table = Table(
65
+ title=f"Project List: Egeria Archvies @ {time.asctime()}",
66
+ header_style="white on dark_blue",
67
+ show_lines=True,
68
+ box=box.ROUNDED,
69
+ caption=f"Archive list for Server '{server}' @ Platform - {url}",
70
+ expand=True,
71
+ )
72
+
73
+ table.add_column("Name")
74
+ table.add_column("Path Name")
75
+ table.add_column("Creation Date")
76
+ # table.add_column("Creator")
77
+ # table.add_column("Description")
78
+
79
+ open_metadata_type_name = None
80
+ property_value = "omarchive"
81
+ property_names = ["fileExtension"]
82
+ archives = c_client.get_elements_by_property_value(
83
+ property_value, property_names, open_metadata_type_name
84
+ )
85
+
86
+ if type(archives) != list:
87
+ raise ValueError("--> No archives found")
88
+ else:
89
+ sorted_archives = sorted(
90
+ archives, key=lambda k: k["properties"].get("name", "---")
91
+ )
92
+
93
+ for archive in sorted_archives:
94
+ name = archive["properties"].get("name", "---")
95
+ path_name = archive["properties"].get("pathName", "---")
96
+ creation_date_epoch = (
97
+ int(archive["properties"].get("storeCreateTime", 0)) / 1000
98
+ )
99
+ create_date = datetime.datetime.fromtimestamp(creation_date_epoch)
100
+ creator = "---"
101
+ description = "---"
102
+
103
+ table.add_row(
104
+ name, path_name, create_date.strftime("%Y-%m-%d %H:%M:%S")
105
+ )
106
+
107
+ return table
108
+
109
+ try:
110
+ # with Live(generate_table(), refresh_per_second=4, screen=True) as live:
111
+ # while True:
112
+ # time.sleep(2)
113
+ # live.update(generate_table())
114
+ console = Console(
115
+ record=True, width=width, force_terminal=not jupyter, soft_wrap=True
116
+ )
117
+ with console.pager():
118
+ console.print(generate_table(), soft_wrap=True)
119
+ if save_output:
120
+ console.save_html("archives.html")
121
+
122
+ except (
123
+ InvalidParameterException,
124
+ PropertyServerException,
125
+ UserNotAuthorizedException,
126
+ ValueError,
127
+ ) as e:
128
+ if type(e) is str:
129
+ print(e)
130
+ else:
131
+ print_exception_response(e)
132
+ except KeyboardInterrupt:
133
+ pass
134
+ finally:
135
+ c_client.close_session()
136
+
137
+
138
+ def main():
139
+ parser = argparse.ArgumentParser()
140
+ parser.add_argument("--server", help="Name of the server to display status for")
141
+ parser.add_argument("--url", help="URL Platform to connect to")
142
+ parser.add_argument("--userid", help="User Id")
143
+ parser.add_argument("--save-output", help="Save output to file?")
144
+ parser.add_argument("--password", help="User Password")
145
+ # parser.add_argument("--sponsor", help="Name of sponsor to search")
146
+ args = parser.parse_args()
147
+
148
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
149
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
150
+ userid = args.userid if args.userid is not None else EGERIA_USER
151
+ user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
152
+
153
+ try:
154
+ save_output = args.save_output if args.save_output is not None else False
155
+ display_archive_list(server, url, userid, user_pass, save_output)
156
+
157
+ except KeyboardInterrupt:
158
+ pass
159
+
160
+
161
+ if __name__ == "__main__":
162
+ main()
@@ -26,6 +26,7 @@ from examples.widgets.cat.list_relationships import list_relationships
26
26
  from examples.widgets.cat.list_tech_types import display_tech_types
27
27
  from examples.widgets.cat.list_todos import display_to_dos as list_todos
28
28
  from examples.widgets.cat.list_user_ids import list_user_ids
29
+ from examples.widgets.cat.list_archives import display_archive_list
29
30
  from examples.widgets.cli.ops_config import Config
30
31
  from examples.widgets.my.list_my_profile import display_my_profile
31
32
  from examples.widgets.my.list_my_roles import display_my_roles
@@ -856,6 +857,16 @@ def show_todos(ctx):
856
857
  )
857
858
 
858
859
 
860
+ @show.command("list-archives")
861
+ @click.pass_context
862
+ def list_archives(ctx):
863
+ """Display a tree graph of information about an asset"""
864
+ c = ctx.obj
865
+ display_archive_list(
866
+ c.view_server, c.view_server_url, c.userid, c.password, None, c.jupyter, c.width
867
+ )
868
+
869
+
859
870
  #
860
871
  # Catalog User: Tell
861
872
  #