pyegeria 0.5.1__py3-none-any.whl → 0.5.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.
- examples/doc_samples/Create_Collection_Sample.py +2 -2
- examples/widgets/developer/get_guid_info.py +2 -1
- pyegeria/__init__.py +3 -2
- pyegeria/utils.py +59 -61
- {pyegeria-0.5.1.dist-info → pyegeria-0.5.2.dist-info}/METADATA +1 -1
- {pyegeria-0.5.1.dist-info → pyegeria-0.5.2.dist-info}/RECORD +9 -9
- {pyegeria-0.5.1.dist-info → pyegeria-0.5.2.dist-info}/LICENSE +0 -0
- {pyegeria-0.5.1.dist-info → pyegeria-0.5.2.dist-info}/WHEEL +0 -0
- {pyegeria-0.5.1.dist-info → pyegeria-0.5.2.dist-info}/entry_points.txt +0 -0
@@ -16,7 +16,7 @@ from pyegeria import CollectionManager, InvalidParameterException, PropertyServe
|
|
16
16
|
view_server = 'view-server'
|
17
17
|
platform_url = 'https://localhost:9443'
|
18
18
|
user = 'erinoverview'
|
19
|
-
console = Console()
|
19
|
+
console = Console(width=200)
|
20
20
|
|
21
21
|
try:
|
22
22
|
c_client = CollectionManager(view_server, platform_url,
|
@@ -40,7 +40,7 @@ try:
|
|
40
40
|
display_name, description, collection_type,
|
41
41
|
is_own_anchor)
|
42
42
|
# Create first folder for Agriculture Insights
|
43
|
-
parent_guid = "
|
43
|
+
parent_guid = "f53ea7c8-3107-4477-8459-9bc63f9e69af"
|
44
44
|
parent_relationship_type_name = "CollectionMembership"
|
45
45
|
display_name = "Agriculture Insights Collection"
|
46
46
|
description = "A folder for agricultural insights data product collections"
|
@@ -58,8 +58,9 @@ def display_guid(guid: str, server: str, url: str, username: str):
|
|
58
58
|
|
59
59
|
except (InvalidParameterException, PropertyServerException, UserNotAuthorizedException, ValueError) as e:
|
60
60
|
if type(e) is str:
|
61
|
-
|
61
|
+
print(e)
|
62
62
|
else:
|
63
|
+
console.print(f"\n Looks like the GUID isn't know...detailed message follows\n")
|
63
64
|
print_exception_response(e)
|
64
65
|
|
65
66
|
def main():
|
pyegeria/__init__.py
CHANGED
@@ -23,7 +23,8 @@ if disable_ssl_warnings:
|
|
23
23
|
|
24
24
|
from ._exceptions import (InvalidParameterException, PropertyServerException, UserNotAuthorizedException,
|
25
25
|
print_exception_response)
|
26
|
-
from .utils import print_response, body_slimmer, wrap_text
|
26
|
+
# from .utils import print_response, body_slimmer, wrap_text
|
27
|
+
from .utils import print_response, body_slimmer
|
27
28
|
from ._client import Client
|
28
29
|
from .automated_curation_omvs import AutomatedCuration
|
29
30
|
from .core_omag_server_config import CoreServerConfig
|
@@ -47,4 +48,4 @@ from .runtime_manager_omvs import RuntimeManager
|
|
47
48
|
from .action_author_omvs import GovernanceAuthor
|
48
49
|
from .glossary_manager_omvs import GlossaryManager
|
49
50
|
|
50
|
-
__version__ = "0.5"
|
51
|
+
__version__ = "0.5.2"
|
pyegeria/utils.py
CHANGED
@@ -6,71 +6,69 @@ General utility functions in support of the Egeria Python Client package.
|
|
6
6
|
|
7
7
|
"""
|
8
8
|
import json
|
9
|
-
import textwrap
|
10
9
|
from rich import print, print_json
|
11
|
-
import pandas as pd
|
12
|
-
from tabulate import tabulate
|
13
10
|
|
14
11
|
|
15
|
-
def wrap_text(df: pd.DataFrame, wrap_len: int = 30) -> pd.DataFrame:
|
16
|
-
""" Wrap the text in a dataframe
|
17
|
-
Parameters
|
18
|
-
----------
|
19
|
-
df : pandas.DataFrame
|
20
|
-
The DataFrame to wrap the text in.
|
21
|
-
wrap_len : int, optional
|
22
|
-
The maximum length of each cell's contents to wrap. Defaults to 30.
|
23
|
-
|
24
|
-
Returns
|
25
|
-
-------
|
26
|
-
pandas.DataFrame
|
27
|
-
A new DataFrame with the wrapped text.
|
28
|
-
|
29
|
-
"""
|
30
|
-
|
31
|
-
# Helper function to wrap text in a particular cell
|
32
|
-
def wrap_cell_contents(cell_contents: str, wrap: int = 30) -> str:
|
33
|
-
""" Wrap the text in a cell
|
34
|
-
Parameters
|
35
|
-
----------
|
36
|
-
cell_contents : str or any
|
37
|
-
The contents of a cell in a dataframe.
|
38
|
-
wrap : int, optional
|
39
|
-
The maximum width at which to wrap the cell contents. Default is 30.
|
40
|
-
|
41
|
-
Returns
|
42
|
-
-------
|
43
|
-
str or any
|
44
|
-
If the cell_contents is a string and its length is greater than wrap_len,
|
45
|
-
the contents are wrapped at wrap_len width using textwrap.
|
46
|
-
Otherwise, the original cell_contents are returned as is.
|
47
|
-
"""
|
48
|
-
if isinstance(cell_contents, str) and len(cell_contents) > wrap:
|
49
|
-
return textwrap.fill(cell_contents, width=wrap)
|
50
|
-
else:
|
51
|
-
return cell_contents
|
52
|
-
|
53
|
-
# Apply the helper function to each element in the DataFrame
|
54
|
-
return df.map(lambda x: wrap_cell_contents(x, wrap_len))
|
55
|
-
|
56
|
-
|
57
|
-
def print_nice_table(df, wrap_len: int = 20, tablefmt: str = "grid") -> None:
|
58
|
-
""" Print a nice table from the data frame"""
|
59
|
-
print(tabulate(wrap_text(df, wrap_len), headers="keys", tablefmt=tablefmt))
|
60
|
-
|
61
12
|
|
62
|
-
def
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
13
|
+
# def wrap_text(df: pd.DataFrame, wrap_len: int = 30) -> pd.DataFrame:
|
14
|
+
# """ Wrap the text in a dataframe
|
15
|
+
# Parameters
|
16
|
+
# ----------
|
17
|
+
# df : pandas.DataFrame
|
18
|
+
# The DataFrame to wrap the text in.
|
19
|
+
# wrap_len : int, optional
|
20
|
+
# The maximum length of each cell's contents to wrap. Defaults to 30.
|
21
|
+
#
|
22
|
+
# Returns
|
23
|
+
# -------
|
24
|
+
# pandas.DataFrame
|
25
|
+
# A new DataFrame with the wrapped text.
|
26
|
+
#
|
27
|
+
# """
|
28
|
+
#
|
29
|
+
# # Helper function to wrap text in a particular cell
|
30
|
+
# def wrap_cell_contents(cell_contents: str, wrap: int = 30) -> str:
|
31
|
+
# """ Wrap the text in a cell
|
32
|
+
# Parameters
|
33
|
+
# ----------
|
34
|
+
# cell_contents : str or any
|
35
|
+
# The contents of a cell in a dataframe.
|
36
|
+
# wrap : int, optional
|
37
|
+
# The maximum width at which to wrap the cell contents. Default is 30.
|
38
|
+
#
|
39
|
+
# Returns
|
40
|
+
# -------
|
41
|
+
# str or any
|
42
|
+
# If the cell_contents is a string and its length is greater than wrap_len,
|
43
|
+
# the contents are wrapped at wrap_len width using textwrap.
|
44
|
+
# Otherwise, the original cell_contents are returned as is.
|
45
|
+
# """
|
46
|
+
# if isinstance(cell_contents, str) and len(cell_contents) > wrap:
|
47
|
+
# return textwrap.fill(cell_contents, width=wrap)
|
48
|
+
# else:
|
49
|
+
# return cell_contents
|
50
|
+
#
|
51
|
+
# # Apply the helper function to each element in the DataFrame
|
52
|
+
# return df.map(lambda x: wrap_cell_contents(x, wrap_len))
|
53
|
+
#
|
54
|
+
#
|
55
|
+
# def print_nice_table(df, wrap_len: int = 20, tablefmt: str = "grid") -> None:
|
56
|
+
# """ Print a nice table from the data frame"""
|
57
|
+
# print(tabulate(wrap_text(df, wrap_len), headers="keys", tablefmt=tablefmt))
|
58
|
+
#
|
59
|
+
#
|
60
|
+
# def get_json_as_table(input_json, wrap_len: int = 30, tablefmt: str = "grid") -> str:
|
61
|
+
# """ return the input json as a table"""
|
62
|
+
# data = json.loads(json.dumps(input_json))
|
63
|
+
# df = pd.json_normalize(data)
|
64
|
+
# return tabulate(wrap_text(df, wrap_len), headers="keys", tablefmt=tablefmt)
|
65
|
+
#
|
66
|
+
#
|
67
|
+
# def print_json_list_as_table(input_json, wrap_len: int = 30, tablefmt: str = "grid") -> None:
|
68
|
+
# """ print a json list as a table"""
|
69
|
+
# data = json.loads(json.dumps(input_json))
|
70
|
+
# df = pd.json_normalize(data)
|
71
|
+
# print(tabulate(wrap_text(df, wrap_len), headers="keys", tablefmt=tablefmt))
|
74
72
|
|
75
73
|
|
76
74
|
def print_rest_request_body(body):
|
@@ -1,4 +1,4 @@
|
|
1
|
-
examples/doc_samples/Create_Collection_Sample.py,sha256=
|
1
|
+
examples/doc_samples/Create_Collection_Sample.py,sha256=D8nhc4qLXIzAqVdJQjmFIS-jL6FzmYCMZyEviXnUbvg,11874
|
2
2
|
examples/doc_samples/Create_Sustainability_Collection_Sample.py,sha256=iLBm1LwRLi42Gayyb-wcWZ5NySQ6sc4kVSmwIAzP2Po,5049
|
3
3
|
examples/widgets/catalog_user/README.md,sha256=aCCVo7iqyE-XGEvmoYXnkIGM0VskF95JTj6Egzec7LM,883
|
4
4
|
examples/widgets/catalog_user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -8,7 +8,7 @@ examples/widgets/catalog_user/view_collection.py,sha256=RWvq_HT5e6JBAiQBc3w94SM6
|
|
8
8
|
examples/widgets/catalog_user/view_glossary.py,sha256=uDAZHJ1WPkkl9S1fzVKJOISjU8LDMPQO9KP4qdmaRnY,4652
|
9
9
|
examples/widgets/developer/README.md,sha256=nxDnfr3BCiGgW5G1VxWxiwUWJXIe5wreNuUeRyIt_hY,1343
|
10
10
|
examples/widgets/developer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
examples/widgets/developer/get_guid_info.py,sha256
|
11
|
+
examples/widgets/developer/get_guid_info.py,sha256=-vOlZfC1lka_evpcwnnNmFU1A88x49kwKIJyYIJzQSg,2549
|
12
12
|
examples/widgets/developer/get_tech_details.py,sha256=HltpixTlzEsD2-z94E-aQBmjcTJ3b1NCCF4wygxp4Dc,3961
|
13
13
|
examples/widgets/developer/list_asset_types.py,sha256=iIA0TX9C_W5u_Bh3RzRMX0x2CdEdH7RFCkUOOP2ZzQw,2847
|
14
14
|
examples/widgets/developer/list_registered_services.py,sha256=oIrE3bSG92C107Q_gFoo7CWYy5LBliQWXElFyiVmRzg,5122
|
@@ -37,7 +37,7 @@ examples/widgets/personal_organizer/view_my_todos.py,sha256=7MGGoxWeoBOuUSsFgu0n
|
|
37
37
|
examples/widgets/personal_organizer/view_open_todos.py,sha256=W_C1yT8usJV9E5BTQP7UeA1ISuDUanszqlWf75mtLZk,3995
|
38
38
|
pyegeria/Xfeedback_manager_omvs.py,sha256=uNQMOPG08UyIuLzBfYt4uezDyLWdpBgJ2ZuvqumaWuY,9231
|
39
39
|
pyegeria/Xloaded_resources_omvs.py,sha256=_1RKeIfq3ga6nvtOzZ5dWcDFgxNiUOPJhnyMv1iCm9s,3377
|
40
|
-
pyegeria/__init__.py,sha256=
|
40
|
+
pyegeria/__init__.py,sha256=xKCym7qw9_KF32reDysCFxfWt0mIyhTZKNrLFazfCXs,2059
|
41
41
|
pyegeria/_client.py,sha256=uQqfjf0JPacEWcDvbKpCvCypbDmAmGHaFQf_UTPK7VQ,23524
|
42
42
|
pyegeria/_deprecated_gov_engine.py,sha256=_DAEHsksnTKGqL9-TaaMVrfnNOrvatNACfg7pJ-ZX4w,17600
|
43
43
|
pyegeria/_exceptions.py,sha256=NJ7vAhmvusK1ENvY2MMrBB6A6TgpYjzS9QJxFH56b8c,18470
|
@@ -58,10 +58,10 @@ pyegeria/project_manager_omvs.py,sha256=_U6m2vquu4eEV7aY8X3hsvfm2zX0EBica1reGWX9
|
|
58
58
|
pyegeria/registered_info.py,sha256=GfMcYz3IO0aNquf8qCrYQ9cA5KplhPx1kNt0_nMMpTM,6475
|
59
59
|
pyegeria/runtime_manager_omvs.py,sha256=WekK7Yeyn6Qu9YmbSDo3m57MN0xOsIm9M8kGHfROZHI,37628
|
60
60
|
pyegeria/server_operations.py,sha256=YBdQJjPOmA1uhrUvzrjUKNGUc5nju9bhvCjF3AbdyWk,16164
|
61
|
-
pyegeria/utils.py,sha256=
|
61
|
+
pyegeria/utils.py,sha256=R1_WwYa8sYJUYR0H8sKrlwEa5BJ32M8-tdfB-zq8Xs4,5282
|
62
62
|
pyegeria/valid_metadata_omvs.py,sha256=aisdRodIwJSkyArAzfm_sEnBELh69xE8k4Nea-vHu8M,36745
|
63
|
-
pyegeria-0.5.
|
64
|
-
pyegeria-0.5.
|
65
|
-
pyegeria-0.5.
|
66
|
-
pyegeria-0.5.
|
67
|
-
pyegeria-0.5.
|
63
|
+
pyegeria-0.5.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
64
|
+
pyegeria-0.5.2.dist-info/METADATA,sha256=BkQ6s2CAiPICBkwkuB-NFhb5rvfoAEEAavSO75rwqTg,2479
|
65
|
+
pyegeria-0.5.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
66
|
+
pyegeria-0.5.2.dist-info/entry_points.txt,sha256=yR22RzRO974vzRMeo7_ysc-_5pxHmgnvyk8FHTZviOw,1950
|
67
|
+
pyegeria-0.5.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|