pyegeria 0.5.9.1__tar.gz → 0.5.9.2__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 (79) hide show
  1. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/PKG-INFO +1 -1
  2. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/cli/egeria_my.py +13 -0
  3. pyegeria-0.5.9.2/examples/widgets/personal/list_my_profile.py +134 -0
  4. pyegeria-0.5.9.1/examples/widgets/personal/list_my_profile.py → pyegeria-0.5.9.2/examples/widgets/personal/list_my_roles.py +2 -2
  5. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyproject.toml +1 -1
  6. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/LICENSE +0 -0
  7. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/README.md +0 -0
  8. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/doc_samples/Create_Collection_Sample.py +0 -0
  9. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/doc_samples/Create_Sustainability_Collection_Sample.py +0 -0
  10. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/README.md +0 -0
  11. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/__init__.py +0 -0
  12. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/get_asset_graph.py +0 -0
  13. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/get_collection.py +0 -0
  14. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/get_tech_type_elements.py +0 -0
  15. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/get_tech_type_template.py +0 -0
  16. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/list_assets.py +0 -0
  17. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/list_glossary.py +0 -0
  18. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/list_projects.py +0 -0
  19. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/list_tech_types.py +0 -0
  20. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/catalog_user/list_todos.py +0 -0
  21. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/cli/__init__.py +0 -0
  22. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/cli/egeria_cat.py +0 -0
  23. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/cli/egeria_ops.py +0 -0
  24. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/cli/egeria_tech.py +0 -0
  25. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/cli/ops_config.py +0 -0
  26. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/README.md +0 -0
  27. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/__init__.py +0 -0
  28. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/engine_actions.py +0 -0
  29. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/integration_daemon_actions.py +0 -0
  30. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/list_catalog_targets.py +0 -0
  31. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/load_archive.py +0 -0
  32. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_asset_events.py +0 -0
  33. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_coco_status.py +0 -0
  34. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_engine_activity.py +0 -0
  35. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_gov_eng_status.py +0 -0
  36. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_integ_daemon_status.py +0 -0
  37. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_platform_status.py +0 -0
  38. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_server_list.py +0 -0
  39. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/monitor_server_status.py +0 -0
  40. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/refresh_integration_daemon.py +0 -0
  41. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/operational/restart_integration_daemon.py +0 -0
  42. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/personal/README.md +0 -0
  43. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/personal/__init__.py +0 -0
  44. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/personal/monitor_my_todos.py +0 -0
  45. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/personal/monitor_open_todos.py +0 -0
  46. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/tech/README.md +0 -0
  47. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/tech/__init__.py +0 -0
  48. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/tech/get_guid_info.py +0 -0
  49. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/tech/get_tech_details.py +0 -0
  50. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/tech/list_asset_types.py +0 -0
  51. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/tech/list_registered_services.py +0 -0
  52. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/tech/list_relationship_types.py +0 -0
  53. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/tech/list_tech_templates.py +0 -0
  54. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/examples/widgets/tech/list_valid_metadata_values.py +0 -0
  55. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/Xfeedback_manager_omvs.py +0 -0
  56. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/Xloaded_resources_omvs.py +0 -0
  57. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/__init__.py +0 -0
  58. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/_client.py +0 -0
  59. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/_deprecated_gov_engine.py +0 -0
  60. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/_exceptions.py +0 -0
  61. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/_globals.py +0 -0
  62. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/_validators.py +0 -0
  63. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/action_author_omvs.py +0 -0
  64. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/asset_catalog_omvs.py +0 -0
  65. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/automated_curation_omvs.py +0 -0
  66. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/collection_manager_omvs.py +0 -0
  67. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/core_omag_server_config.py +0 -0
  68. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/create_tech_guid_lists.py +0 -0
  69. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/full_omag_server_config.py +0 -0
  70. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/glossary_browser_omvs.py +0 -0
  71. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/glossary_manager_omvs.py +0 -0
  72. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/my_profile_omvs.py +0 -0
  73. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/platform_services.py +0 -0
  74. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/project_manager_omvs.py +0 -0
  75. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/registered_info.py +0 -0
  76. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/runtime_manager_omvs.py +0 -0
  77. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/server_operations.py +0 -0
  78. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/utils.py +0 -0
  79. {pyegeria-0.5.9.1 → pyegeria-0.5.9.2}/pyegeria/valid_metadata_omvs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyegeria
3
- Version: 0.5.9.1
3
+ Version: 0.5.9.2
4
4
  Summary: A python client for Egeria
5
5
  Home-page: https://github.com/odpi/egeria-python
6
6
  License: Apache 2.0
@@ -17,6 +17,7 @@ from examples.widgets.cli.ops_config import Config
17
17
  from examples.widgets.personal.monitor_open_todos import display_todos
18
18
  from examples.widgets.personal.monitor_my_todos import display_my_todos
19
19
  from examples.widgets.personal.list_my_profile import display_my_profiles
20
+ from examples.widgets.personal.list_my_roles import display_my_roles
20
21
 
21
22
 
22
23
 
@@ -100,6 +101,18 @@ def show_my_profile(ctx):
100
101
  display_my_profiles( c.view_server, c.view_server_url,
101
102
  c.userid, c.password, c.jupyter, c.width)
102
103
 
104
+ @show.command('my-roles')
105
+ @click.pass_context
106
+ def show_my_roles(ctx):
107
+ """Display my profiles
108
+
109
+ Usage: show my-profile
110
+
111
+ """
112
+ c = ctx.obj
113
+ display_my_roles( c.view_server, c.view_server_url,
114
+ c.userid, c.password, c.jupyter, c.width)
115
+
103
116
 
104
117
  @show.command('my-to-dos')
105
118
  @click.pass_context
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SPDX-License-Identifier: Apache-2.0
4
+ Copyright Contributors to the ODPi Egeria project.
5
+
6
+ Unit tests for the Utils helper functions using the Pytest framework.
7
+
8
+
9
+ A simple display for my profile
10
+ """
11
+ import os
12
+ import argparse
13
+ import time
14
+ import sys
15
+
16
+ from rich import box, print
17
+ from rich.console import Console
18
+ from rich.table import Table
19
+ from rich.tree import Tree
20
+ from rich.panel import Panel
21
+ from rich.markdown import Markdown
22
+
23
+ from pyegeria import (
24
+ InvalidParameterException,
25
+ PropertyServerException,
26
+ UserNotAuthorizedException,
27
+ print_exception_response,
28
+ )
29
+ from pyegeria.my_profile_omvs import MyProfile
30
+
31
+ disable_ssl_warnings = True
32
+ EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
33
+ EGERIA_KAFKA_ENDPOINT = os.environ.get('KAFKA_ENDPOINT', 'localhost:9092')
34
+ EGERIA_PLATFORM_URL = os.environ.get('EGERIA_PLATFORM_URL', 'https://localhost:9443')
35
+ EGERIA_VIEW_SERVER = os.environ.get('VIEW_SERVER', 'view-server')
36
+ EGERIA_VIEW_SERVER_URL = os.environ.get('EGERIA_VIEW_SERVER_URL', 'https://localhost:9443')
37
+ EGERIA_INTEGRATION_DAEMON = os.environ.get('INTEGRATION_DAEMON', 'integration-daemon')
38
+ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get('EGERIA_INTEGRATION_DAEMON_URL', 'https://localhost:9443')
39
+ EGERIA_ADMIN_USER = os.environ.get('ADMIN_USER', 'garygeeke')
40
+ EGERIA_ADMIN_PASSWORD = os.environ.get('ADMIN_PASSWORD', 'secret')
41
+ EGERIA_USER = os.environ.get('EGERIA_USER', 'erinoverview')
42
+ EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
43
+ EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
44
+ EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '250'))
45
+
46
+ def display_my_profile(server: str, url: str, username: str, user_pass:str,
47
+ jupyter:bool=EGERIA_JUPYTER, width:int = EGERIA_WIDTH):
48
+
49
+ try:
50
+ m_client = MyProfile(server, url, user_id=username, user_pwd=user_pass)
51
+ token = m_client.create_egeria_bearer_token(username, user_pass)
52
+ my_profiles = m_client.get_my_profile()
53
+ if type(my_profiles) is str:
54
+ print(f"No profiles found for {username}")
55
+ sys.exit(1)
56
+
57
+ console = Console(width=width, force_terminal=not jupyter, soft_wrap=True)
58
+
59
+ profile_props = my_profiles.get('profileProperties','---')
60
+ name = profile_props["fullName"]
61
+ tree = Tree(Panel(f"Profile of {name}",title = "Personal Profile"),
62
+ expanded=True,style="bright_white on black", guide_style="bold bright_blue")
63
+
64
+ profile_props_md = f"\n* GUID: {my_profiles["elementHeader"]["guid"]}\n"
65
+ if type(profile_props) is dict:
66
+ for key in profile_props.keys():
67
+ if type(profile_props[key]) is str:
68
+ profile_props_md += f"* {key}: {profile_props[key]}\n"
69
+ elif type(profile_props[key]) is dict:
70
+ p_md = '\n* Additional Details:\n'
71
+ for k in profile_props[key].keys():
72
+ p_md += f"\t* {k}: {profile_props[key][k]}\n"
73
+ profile_props_md += p_md
74
+ t1 = tree.add(Panel(Markdown(profile_props_md),title="Profile Properties"))
75
+
76
+
77
+ id_list_md=""
78
+ for identities in my_profiles["userIdentities"]:
79
+ id_list_md += f"* {identities['userIdentity']['properties']['userId']}\n"
80
+ t2 = tree.add(Panel(Markdown(id_list_md), title="Identities"))
81
+
82
+ contact_methods = my_profiles['contactMethods']
83
+ for method in contact_methods:
84
+ contact = method['properties']
85
+ contact_methods_md = ""
86
+ for key in contact.keys():
87
+ contact_methods_md += f"* {key}: {contact[key]}\n"
88
+ t3 = tree.add(Panel(Markdown(contact_methods_md), title="Contact Methods"))
89
+
90
+ my_roles = my_profiles["roles"]
91
+ table = Table(
92
+ title = f" Roles of {name}",
93
+ show_lines= True,
94
+ box=box.ROUNDED,
95
+ expand= True,
96
+ )
97
+ table.add_column("Role Type")
98
+ table.add_column("Role")
99
+ table.add_column("Role GUID")
100
+ for a_role in my_roles:
101
+ my_role_props = a_role["properties"]
102
+ role_type = my_role_props["typeName"]
103
+ role = my_role_props.get("title"," ")
104
+ role_guid = a_role["elementHeader"]["guid"]
105
+ table.add_row(
106
+ role_type, role, role_guid
107
+ )
108
+ t4 = tree.add(Panel(table, title="Roles" ),expanded=True)
109
+
110
+ print(tree)
111
+
112
+ except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException) as e:
113
+ print_exception_response(e)
114
+ finally:
115
+ m_client.close_session()
116
+
117
+ def main():
118
+ parser = argparse.ArgumentParser()
119
+ parser.add_argument("--server", help="Name of the server to display status for")
120
+ parser.add_argument("--url", help="URL Platform to connect to")
121
+ parser.add_argument("--userid", help="User Id")
122
+ parser.add_argument("--password", help="User Password")
123
+
124
+ args = parser.parse_args()
125
+
126
+ server = args.server if args.server is not None else EGERIA_VIEW_SERVER
127
+ url = args.url if args.url is not None else EGERIA_PLATFORM_URL
128
+ userid = args.userid if args.userid is not None else EGERIA_USER
129
+ user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
130
+
131
+ display_my_profile(server, url, userid, user_pass)
132
+
133
+ if __name__ == "__main__":
134
+ main()
@@ -40,7 +40,7 @@ EGERIA_USER_PASSWORD = os.environ.get('EGERIA_USER_PASSWORD', 'secret')
40
40
  EGERIA_JUPYTER = bool(os.environ.get('EGERIA_JUPYTER', 'False'))
41
41
  EGERIA_WIDTH = int(os.environ.get('EGERIA_WIDTH', '200'))
42
42
 
43
- def display_my_profiles(server: str, url: str, username: str, user_pass:str,
43
+ def display_my_roles(server: str, url: str, username: str, user_pass:str,
44
44
  jupyter:bool=EGERIA_JUPYTER, width:int = EGERIA_WIDTH):
45
45
 
46
46
  m_client = MyProfile(server, url, user_id=username, user_pwd=user_pass)
@@ -128,7 +128,7 @@ def main():
128
128
  userid = args.userid if args.userid is not None else EGERIA_USER
129
129
  user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
130
130
 
131
- display_my_profiles(server, url, userid, user_pass)
131
+ display_my_roles(server, url, userid, user_pass)
132
132
 
133
133
  if __name__ == "__main__":
134
134
  main()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyegeria"
3
- version = "0.5.9.1"
3
+ version = "0.5.9.2"
4
4
  license = 'Apache 2.0'
5
5
  authors = ["Dan Wolfson <dan.wolfson@pdr-associates.com>"]
6
6
  readme = "README.md"
File without changes
File without changes
File without changes