pyegeria 5.3.4.1__py3-none-any.whl → 5.3.4.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyegeria
3
- Version: 5.3.4.1
3
+ Version: 5.3.4.2
4
4
  Summary: A python client for Egeria
5
5
  License: Apache 2.0
6
6
  Keywords: egeria,metadata,governance
@@ -20,7 +20,6 @@ pyegeria/commands/cat/get_project_dependencies.py,sha256=NCUTAHAzScjQwoAHLf1DC9r
20
20
  pyegeria/commands/cat/get_project_structure.py,sha256=h6q5Ps3xRhV2Zqh6295nDCgVThUrWX5O-JC0qaSIM5s,5976
21
21
  pyegeria/commands/cat/get_tech_type_elements.py,sha256=9F0wBy8ireLFHLNChxkM4A7xJ4uFL4XKdXlm6roDk2I,6185
22
22
  pyegeria/commands/cat/glossary_actions.py,sha256=MjKHzmJXoF6t9wsjg4h3T3JxQPdADoH6CwuLBjv0MnY,12678
23
- pyegeria/commands/cat/link-check.py,sha256=WwZSPpe6kRbM7u2X1VVrGyOh_WsG8UORrkNvXDC8eGY,6685
24
23
  pyegeria/commands/cat/list_assets.py,sha256=2fUlV-VL5vXb4T9wD87gusylY0O9wLRujDWPmaQJkNI,6277
25
24
  pyegeria/commands/cat/list_cert_types.py,sha256=WOtUQWGtqFUvV3-pQh5iy4dDaESMfxER6DmOo8gzPtY,7130
26
25
  pyegeria/commands/cat/list_collections.py,sha256=hP0j6R0oJfnT_KDT5MyR74RmWuXaHFs2VszHnZ-C8VU,5989
@@ -430,8 +429,8 @@ pyegeria/template_manager_omvs.py,sha256=Sw5xsQAhy7a48xFCg59mg9_nqyhawoS9v4WyF-P
430
429
  pyegeria/utils.py,sha256=1h6bwveadd6GpbnGLTmqPBmBk68QvxdjGTI9RfbrgKY,5415
431
430
  pyegeria/valid_metadata_omvs.py,sha256=cCt5CCLv6BdzCu90n68r_PkG_PEQJjrtwCxio7K6yko,65034
432
431
  pyegeria/x_action_author_omvs.py,sha256=xu1IQ0YbhIKi17C5a7Aq9u1Az2czwahNPpX9czmyVxE,6454
433
- pyegeria-5.3.4.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
434
- pyegeria-5.3.4.1.dist-info/METADATA,sha256=WUeb8V2P1QSHXXlU5mmr2GAp-cz_xQdOeSn0ssI3hYM,2735
435
- pyegeria-5.3.4.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
436
- pyegeria-5.3.4.1.dist-info/entry_points.txt,sha256=YI9GDJV28OROUSM9bpkdevNvpDpqSw6EBAMM_uMyrVo,6229
437
- pyegeria-5.3.4.1.dist-info/RECORD,,
432
+ pyegeria-5.3.4.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
433
+ pyegeria-5.3.4.2.dist-info/METADATA,sha256=1n7-wcd7RA08Xp4EzbaLqTd3NVXVXyFMdq4xQxWT-v8,2735
434
+ pyegeria-5.3.4.2.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
435
+ pyegeria-5.3.4.2.dist-info/entry_points.txt,sha256=E83aZ9RhrxffYGmHgBwhLdS5fvEeYhrIPp0FZRvaFOI,6180
436
+ pyegeria-5.3.4.2.dist-info/RECORD,,
@@ -22,7 +22,6 @@ hey_egeria_cat=pyegeria.commands.cli.egeria_cat:cli
22
22
  hey_egeria_my=pyegeria.commands.cli.egeria_my:cli
23
23
  hey_egeria_ops=pyegeria.commands.cli.egeria_ops:cli
24
24
  hey_egeria_tech=pyegeria.commands.cli.egeria_tech:cli
25
- link_check=pyegeria.commands.cat.link-check:main
26
25
  list_all_related_elements=pyegeria.commands.tech.list_all_related_elements:main
27
26
  list_anchored_elements=pyegeria.commands.tech.list_anchored_elements:main
28
27
  list_archives=pyegeria.commands.ops.list_archives:main
@@ -1,185 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- SPDX-License-Identifier: Apache-2.0
4
- Copyright Contributors to the ODPi Egeria project.
5
-
6
- List certification types
7
-
8
-
9
- A simple display for certification types
10
- """
11
- import argparse
12
- import os
13
- import sys
14
- import time
15
- import json
16
-
17
- from rich import box
18
- from rich.console import Console
19
- from rich.prompt import Prompt
20
- from rich.markdown import Markdown
21
- from rich.table import Table
22
- from rich.text import Text
23
-
24
- from pyegeria import (
25
- InvalidParameterException,
26
- PropertyServerException,
27
- UserNotAuthorizedException,
28
- print_exception_response,
29
- AssetCatalog,
30
- ClassificationManager,
31
- )
32
-
33
- EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
34
- EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
35
- EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
36
- EGERIA_VIEW_SERVER = os.environ.get("EGERIA_VIEW_SERVER", "view-server")
37
- EGERIA_VIEW_SERVER_URL = os.environ.get(
38
- "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
39
- )
40
- EGERIA_INTEGRATION_DAEMON = os.environ.get("INTEGRATION_DAEMON", "integration-daemon")
41
- EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke")
42
- EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret")
43
- EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview")
44
- EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret")
45
- EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False"))
46
- EGERIA_WIDTH = int(os.environ.get("EGERIA_WIDTH", "200"))
47
-
48
-
49
- disable_ssl_warnings = True
50
-
51
-
52
- def display_certifications(
53
- search_string: str,
54
- server: str,
55
- url: str,
56
- username: str,
57
- user_password: str,
58
- time_out: int = 60,
59
- jupyter: bool = EGERIA_JUPYTER,
60
- width: int = EGERIA_WIDTH,
61
- ):
62
- console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
63
- if (search_string is None) or ((len(search_string) < 3)) and (search_string != "*"):
64
- raise ValueError(
65
- "Invalid Search String - must be greater than four characters long"
66
- )
67
- g_client = ClassificationManager(
68
- server, url, user_id=username, user_pwd=user_password
69
- )
70
- token = g_client.create_egeria_bearer_token(username, user_password)
71
-
72
- def generate_table(search_string: str = None) -> Table:
73
- """Make a new table."""
74
- table = Table(
75
- title=f"Certifications Types @ {time.asctime()}",
76
- header_style="white on dark_blue",
77
- style="bold white on black",
78
- row_styles=["bold white on black"],
79
- title_style="bold white on black",
80
- caption_style="white on black",
81
- show_lines=True,
82
- box=box.ROUNDED,
83
- caption=f"View Server '{server}' @ Platform - {url}",
84
- expand=True,
85
- )
86
- table.add_column("Title", max_width=15)
87
- table.add_column("summary")
88
- table.add_column("domainID")
89
- table.add_column("Unique Name", width=38)
90
- table.add_column("Scope", width=38)
91
- # table.add_column("Qualified Name",max_width=15)
92
- table.add_column("Description",width=38)
93
- table.add_column("Details")
94
-
95
-
96
- certs = g_client.get_elements(search_string, page_size=100, time_out=time_out)
97
- if type(certs) is str:
98
- return table
99
-
100
- for element in certs:
101
- properties = element["properties"]
102
- summary = properties.get("summary", "---")
103
- domain = properties.get("domainIdentifier", "---")
104
- unique_name = properties.get("qualifiedName", "---")
105
- scope = properties.get("scope", "---")
106
- description = properties.get("description", "---")
107
- details = properties.get("details", "---")
108
- title = properties.get("title", "---")
109
- cert_guid = element["elementHeader"]["guid"]
110
-
111
- related = g_client.get_related_elements(cert_guid)
112
- if (len(related) > 0) and (type(related) is list):
113
- rel_md = ""
114
- for rel in related:
115
- rel_type = rel["relationshipHeader"]["type"]["typeName"]
116
- rel_element_props = rel["relatedElement"]["properties"]
117
- rel_el_md = f"* Rel Type: {rel_type}\n"
118
- for key in rel_element_props.keys():
119
- rel_el_md += f"* {key}: {rel_element_props[key]}\n"
120
- rel_md += f"----\n{rel_el_md}\n"
121
- else:
122
- rel_md = "---"
123
-
124
-
125
- unique_name = "Visit my [link=https://www.willmcgugan.com]blog[/link]!"
126
- scope = Text("[link=https://egeria-project.org]Egeria[/link]")
127
- description = Markdown('[egeria]("https://egeria-project.org")')
128
- details = "https://pdr-associates.com"
129
- table.add_row(
130
- title, summary, domain, unique_name, scope, description, details
131
- )
132
-
133
- g_client.close_session()
134
-
135
- return table
136
-
137
- try:
138
- # with Live(generate_table(), refresh_per_second=4, screen=True) as live:
139
- # while True:
140
- # time.sleep(2)
141
- # live.update(generate_table())
142
-
143
- with console.pager(styles=True):
144
- console.print(generate_table(search_string), soft_wrap=True)
145
-
146
- except (
147
- InvalidParameterException,
148
- PropertyServerException,
149
- UserNotAuthorizedException,
150
- ) as e:
151
- console.print_exception()
152
- sys.exit(1)
153
-
154
- except ValueError as e:
155
- console.print(
156
- f"\n\n====> Invalid Search String - must be greater than four characters long"
157
- )
158
- sys.exit(1)
159
-
160
-
161
- def main():
162
- parser = argparse.ArgumentParser()
163
- parser.add_argument("--server", help="Name of the server to display status for")
164
- parser.add_argument("--url", help="URL Platform to connect to")
165
- parser.add_argument("--userid", help="User Id")
166
- parser.add_argument("--password", help="User Password")
167
- parser.add_argument("--time_out", help="Time Out")
168
-
169
- args = parser.parse_args()
170
-
171
- server = args.server if args.server is not None else EGERIA_VIEW_SERVER
172
- url = args.url if args.url is not None else EGERIA_PLATFORM_URL
173
- userid = args.userid if args.userid is not None else EGERIA_USER
174
- user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
175
- time_out = args.time_out if args.time_out is not None else 60
176
- try:
177
- # search_string = Prompt.ask("Enter an asset search string:", default="*")
178
- search_string = "CertificationType"
179
- display_certifications(search_string, server, url, userid, user_pass, time_out)
180
- except KeyboardInterrupt:
181
- pass
182
-
183
-
184
- if __name__ == "__main__":
185
- main()