pyegeria 5.3.6.5__py3-none-any.whl → 5.3.6.6__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.
- pyegeria/commands/cat/dr_egeria_md.py +46 -17
- pyegeria/commands/cli/egeria.py +15 -0
- pyegeria/commands/cli/egeria_cat.py +27 -8
- pyegeria/egeria_client.py +4 -1
- {pyegeria-5.3.6.5.dist-info → pyegeria-5.3.6.6.dist-info}/METADATA +1 -1
- {pyegeria-5.3.6.5.dist-info → pyegeria-5.3.6.6.dist-info}/RECORD +9 -9
- {pyegeria-5.3.6.5.dist-info → pyegeria-5.3.6.6.dist-info}/entry_points.txt +1 -1
- {pyegeria-5.3.6.5.dist-info → pyegeria-5.3.6.6.dist-info}/LICENSE +0 -0
- {pyegeria-5.3.6.5.dist-info → pyegeria-5.3.6.6.dist-info}/WHEEL +0 -0
@@ -1,15 +1,17 @@
|
|
1
1
|
"""
|
2
2
|
This is an ongoing experiment in parsing and playing with Freddie docs
|
3
3
|
"""
|
4
|
+
import argparse
|
4
5
|
import json
|
5
6
|
import os
|
6
7
|
from rich import print
|
7
8
|
from rich.console import Console
|
8
9
|
from rich.markdown import Markdown
|
10
|
+
from rich.prompt import Prompt
|
9
11
|
|
10
|
-
from pyegeria
|
11
|
-
|
12
|
-
|
12
|
+
from pyegeria import (extract_command, process_glossary_upsert_command, process_term_upsert_command,
|
13
|
+
get_current_datetime_string, process_per_proj_upsert_command, commands,
|
14
|
+
process_provenance_command)
|
13
15
|
|
14
16
|
import click
|
15
17
|
from pyegeria import (extract_command, process_glossary_upsert_command, process_term_upsert_command,
|
@@ -41,20 +43,20 @@ EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", "/Users/dwolfson/localGit/
|
|
41
43
|
EGERIA_INBOX_PATH = os.environ.get("EGERIA_INBOX_PATH", "pyegeria/commands/cat/dr_egeria_inbox")
|
42
44
|
EGERIA_OUTBOX_PATH = os.environ.get("EGERIA_OUTBOX_PATH", "pyegeria/commands/cat/dr_egeria_outbox")
|
43
45
|
|
44
|
-
console = Console(width=int(EGERIA_WIDTH))
|
45
46
|
|
46
47
|
|
47
48
|
|
48
|
-
|
49
|
-
@click.
|
50
|
-
|
51
|
-
|
52
|
-
@click.option("--
|
53
|
-
@click.option(
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
@click.option("--
|
49
|
+
|
50
|
+
# @click.command("process_markdown_file", help="Process a markdown file and return the output as a string.")
|
51
|
+
# @click.option("--file-path", help="File path to markdown file",
|
52
|
+
# default="glossary_exp.md")
|
53
|
+
# @click.option("--directive", default="display-only", help="How to process the file")
|
54
|
+
# @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use.")
|
55
|
+
# @click.option(
|
56
|
+
# "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
|
57
|
+
# )
|
58
|
+
# @click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
59
|
+
# @click.option("--user_pass", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
58
60
|
def process_markdown_file(
|
59
61
|
file_path: str,
|
60
62
|
directive: str,
|
@@ -62,8 +64,11 @@ def process_markdown_file(
|
|
62
64
|
url: str,
|
63
65
|
userid: str,
|
64
66
|
user_pass: str,
|
65
|
-
):
|
66
|
-
|
67
|
+
)-> None:
|
68
|
+
"""
|
69
|
+
Process a markdown file by parsing and executing Dr. Egeria commands. Write output to a new file.
|
70
|
+
"""
|
71
|
+
console = Console(width=int(EGERIA_WIDTH))
|
67
72
|
client = EgeriaTech(server, url, user_id=userid)
|
68
73
|
token = client.create_egeria_bearer_token(userid, user_pass)
|
69
74
|
|
@@ -160,5 +165,29 @@ def process_markdown_file(
|
|
160
165
|
console.print_exception(show_locals=True)
|
161
166
|
|
162
167
|
|
168
|
+
def main():
|
169
|
+
parser = argparse.ArgumentParser()
|
170
|
+
parser.add_argument("--server", help="Name of the server to display status for")
|
171
|
+
parser.add_argument("--url", help="URL Platform to connect to")
|
172
|
+
parser.add_argument("--userid", help="User Id")
|
173
|
+
parser.add_argument("--password", help="User Password")
|
174
|
+
parser.add_argument("--time_out", help="Time Out")
|
175
|
+
|
176
|
+
args = parser.parse_args()
|
177
|
+
|
178
|
+
server = args.server if args.server is not None else EGERIA_VIEW_SERVER
|
179
|
+
url = args.url if args.url is not None else EGERIA_PLATFORM_URL
|
180
|
+
userid = args.userid if args.userid is not None else EGERIA_USER
|
181
|
+
user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
182
|
+
time_out = args.time_out if args.time_out is not None else 60
|
183
|
+
try:
|
184
|
+
file_path = Prompt.ask("Markdown File name to process:", default="")
|
185
|
+
directive = Prompt.ask("Processing Directive:", choices=[ "display", "validate", "process"], default="validate")
|
186
|
+
|
187
|
+
process_markdown_file(file_path, directive, server, url, userid, user_pass)
|
188
|
+
except KeyboardInterrupt:
|
189
|
+
pass
|
190
|
+
|
191
|
+
|
163
192
|
if __name__ == "__main__":
|
164
|
-
|
193
|
+
main()
|
pyegeria/commands/cli/egeria.py
CHANGED
@@ -54,6 +54,8 @@ from pyegeria.commands.cat.list_terms import display_glossary_terms
|
|
54
54
|
from pyegeria.commands.cat.list_todos import display_to_dos as list_todos
|
55
55
|
from pyegeria.commands.cat.list_user_ids import list_user_ids
|
56
56
|
|
57
|
+
from pyegeria.commands.cat.dr_egeria_md import process_markdown_file
|
58
|
+
|
57
59
|
from pyegeria.commands.cli.egeria_login_tui import login
|
58
60
|
from pyegeria.commands.cli.egeria_ops import show_server
|
59
61
|
from pyegeria.commands.cli.ops_config import Config
|
@@ -374,6 +376,7 @@ my_tell.add_command(mark_todo_complete)
|
|
374
376
|
my_tell.add_command(reassign_todo)
|
375
377
|
|
376
378
|
|
379
|
+
|
377
380
|
#
|
378
381
|
# tech User: Show
|
379
382
|
#
|
@@ -1457,6 +1460,18 @@ def tell_cat(ctx):
|
|
1457
1460
|
"""Perform actions an Egeria Objects"""
|
1458
1461
|
pass
|
1459
1462
|
|
1463
|
+
#
|
1464
|
+
# dr.egeria
|
1465
|
+
#
|
1466
|
+
@tell_cat.group("dr_egeria")
|
1467
|
+
@click.pass_context
|
1468
|
+
def dr_egeria(ctx):
|
1469
|
+
"""Execute Dr.Egeria actions"""
|
1470
|
+
pass
|
1471
|
+
|
1472
|
+
dr_egeria.add_command(process_markdown_file)
|
1473
|
+
|
1474
|
+
|
1460
1475
|
|
1461
1476
|
@tell_cat.group("glossary")
|
1462
1477
|
@click.pass_context
|
@@ -14,6 +14,7 @@ import os
|
|
14
14
|
import click
|
15
15
|
from trogon import tui
|
16
16
|
|
17
|
+
from pyegeria.commands.cat.dr_egeria_md import process_markdown_file
|
17
18
|
from pyegeria.commands.cat.get_asset_graph import asset_viewer
|
18
19
|
from pyegeria.commands.cat.get_collection import collection_viewer
|
19
20
|
from pyegeria.commands.cat.get_project_dependencies import project_dependency_viewer
|
@@ -31,22 +32,18 @@ from pyegeria.commands.cat.glossary_actions import (
|
|
31
32
|
delete_category,
|
32
33
|
add_term_to_category,
|
33
34
|
remove_term_from_category)
|
34
|
-
|
35
|
-
from pyegeria.commands.cat.dr_egeria_jupyter import process_jupyter_notebook
|
36
|
-
from pyegeria.commands.cat.dr_egeria_md_file import process_markdown_file
|
37
|
-
|
38
|
-
from pyegeria.commands.cat.list_categories import display_categories
|
39
35
|
from pyegeria.commands.cat.list_assets import display_assets
|
36
|
+
from pyegeria.commands.cat.list_categories import display_categories
|
40
37
|
from pyegeria.commands.cat.list_cert_types import display_certifications
|
41
38
|
from pyegeria.commands.cat.list_collections import display_collections
|
42
39
|
from pyegeria.commands.cat.list_deployed_catalogs import list_deployed_catalogs
|
43
40
|
from pyegeria.commands.cat.list_deployed_database_schemas import (
|
44
41
|
list_deployed_database_schemas,
|
45
|
-
)
|
42
|
+
)
|
46
43
|
from pyegeria.commands.cat.list_deployed_databases import list_deployed_databases
|
44
|
+
from pyegeria.commands.cat.list_deployed_servers import display_servers_by_dep_imp
|
47
45
|
from pyegeria.commands.cat.list_glossaries import display_glossaries
|
48
46
|
from pyegeria.commands.cat.list_projects import display_project_list
|
49
|
-
from pyegeria.commands.cat.list_deployed_servers import display_servers_by_dep_imp
|
50
47
|
from pyegeria.commands.cat.list_tech_type_elements import list_tech_elements
|
51
48
|
from pyegeria.commands.cat.list_tech_types import display_tech_types
|
52
49
|
from pyegeria.commands.cat.list_terms import display_glossary_terms
|
@@ -58,7 +55,7 @@ from pyegeria.commands.my.todo_actions import (
|
|
58
55
|
delete_todo,
|
59
56
|
mark_todo_complete,
|
60
57
|
reassign_todo,
|
61
|
-
)
|
58
|
+
)
|
62
59
|
from pyegeria.commands.tech.list_asset_types import display_asset_types
|
63
60
|
|
64
61
|
|
@@ -668,6 +665,26 @@ def tell(ctx):
|
|
668
665
|
"""Perform actions an Egeria Objects"""
|
669
666
|
pass
|
670
667
|
|
668
|
+
#
|
669
|
+
# dr.egeria
|
670
|
+
#
|
671
|
+
@tell.group("dr_egeria")
|
672
|
+
@click.pass_context
|
673
|
+
def tell_dr_egeria(ctx):
|
674
|
+
"""Execute Dr.Egeria actions"""
|
675
|
+
pass
|
676
|
+
|
677
|
+
@tell_dr_egeria.command("process_markdown_file")
|
678
|
+
@click.option("--file-path", help="File path to markdown file",
|
679
|
+
default="glossary_exp.md")
|
680
|
+
@click.option("--directive", type=click.Choice(['Display','Validate','Process'], case_sensitive=False),
|
681
|
+
default="validate", help="How to process the file")
|
682
|
+
@click.pass_context
|
683
|
+
def process_markdown_file(ctx, file_path, directive):
|
684
|
+
"""Process a markdown file"""
|
685
|
+
c = ctx.obj
|
686
|
+
process_markdown_file(file_path, directive, c.view_server, c.view_server_url, c.userid, c.password)
|
687
|
+
|
671
688
|
|
672
689
|
@tell.group("glossary")
|
673
690
|
@click.pass_context
|
@@ -676,6 +693,8 @@ def tell_glossary(ctx):
|
|
676
693
|
pass
|
677
694
|
|
678
695
|
|
696
|
+
|
697
|
+
|
679
698
|
tell_glossary.add_command(create_glossary)
|
680
699
|
tell_glossary.add_command(delete_glossary)
|
681
700
|
tell_glossary.add_command(create_term)
|
pyegeria/egeria_client.py
CHANGED
@@ -27,7 +27,8 @@ from pyegeria.solution_architect_omvs import SolutionArchitect
|
|
27
27
|
from pyegeria.server_operations import ServerOps
|
28
28
|
from pyegeria.registered_info import RegisteredInfo
|
29
29
|
from pyegeria.valid_metadata_omvs import ValidMetadataManager
|
30
|
-
|
30
|
+
from pyegeria.egeria_config_client import EgeriaConfig
|
31
|
+
from pyegeria.md_processing_utils import render_markdown
|
31
32
|
|
32
33
|
|
33
34
|
class Egeria(
|
@@ -49,6 +50,8 @@ class Egeria(
|
|
49
50
|
ValidMetadataManager,
|
50
51
|
MetadataExplorer,
|
51
52
|
SolutionArchitect,
|
53
|
+
EgeriaMy,
|
54
|
+
EgeriaConfig,
|
52
55
|
):
|
53
56
|
"""
|
54
57
|
Client to issue Runtime status requests.
|
@@ -17,7 +17,7 @@ pyegeria/commands/cat/__init__.py,sha256=5OCy4m_yZsnSxdy_gvkCyP_OkjvuWKimqUGHYCJ
|
|
17
17
|
pyegeria/commands/cat/dr_egeria_inbox/glossary_creation_experiment.ipynb,sha256=dbzNu90fCKNohOWVSRBOB1GLyd95x8Qw51I5AkaPtso,11552
|
18
18
|
pyegeria/commands/cat/dr_egeria_inbox/glossary_exp.md,sha256=KsUeTzDe5QkrTmIfIAXR74qZ29oSfRW-NAEn0RYIRqM,2534
|
19
19
|
pyegeria/commands/cat/dr_egeria_jupyter.py,sha256=4LcmD5CrtazLgUK_LCjgOnwtxZqTBB6lrMR8tsugl94,6036
|
20
|
-
pyegeria/commands/cat/dr_egeria_md.py,sha256=
|
20
|
+
pyegeria/commands/cat/dr_egeria_md.py,sha256=HlCgBRrECsi5UL1L_f_d5RMcuHMzK0W26nLWK5nqitc,9052
|
21
21
|
pyegeria/commands/cat/exp_list_glossaries.py,sha256=dC6Bnfm3YSMTKPP146qeslIFRiZnGu5b7iDYE07p4iU,5817
|
22
22
|
pyegeria/commands/cat/get_asset_graph.py,sha256=xnXJfpDTVH1TJ2TwE3dtjaXU36Di6-N6JAyhothzz2o,12461
|
23
23
|
pyegeria/commands/cat/get_collection.py,sha256=kXPcP8u-SMWfrVyyBhNoxG8mcgB7EV_5i9N9w_IBU7o,5379
|
@@ -41,8 +41,8 @@ pyegeria/commands/cat/list_terms.py,sha256=D0tCD2f8j-UgnV4Bgisj9a11CCEOneNsRT7_3
|
|
41
41
|
pyegeria/commands/cat/list_todos.py,sha256=NitCw0uyVVjmN1hxb1W-I4FbOsa8wQxW2ICyOElHyc8,6556
|
42
42
|
pyegeria/commands/cat/list_user_ids.py,sha256=X5Q-YNEp38saPYDuy9VwdQC5Qpa4HyC3WvAdbyp_P6M,5108
|
43
43
|
pyegeria/commands/cli/__init__.py,sha256=hpTVSMP2gnPRhcAZPdeUEsQ-eaDySlXlk239dNWYmng,292
|
44
|
-
pyegeria/commands/cli/egeria.py,sha256=
|
45
|
-
pyegeria/commands/cli/egeria_cat.py,sha256=
|
44
|
+
pyegeria/commands/cli/egeria.py,sha256=_Z__gugx11bpwyWU6Uiacw_0r0q5o4mbAZ-ipDozFwc,52884
|
45
|
+
pyegeria/commands/cli/egeria_cat.py,sha256=uYI_KD_9iAOgx5zsSWPpvK8MK3ymJcMmsTRONfbQDkM,18848
|
46
46
|
pyegeria/commands/cli/egeria_login_tui.py,sha256=W5ouG3nlN7z2Waa-wzYFS7yyoGfOrK-lNB0FMt2JdOk,9492
|
47
47
|
pyegeria/commands/cli/egeria_my.py,sha256=0KTH7OIeKyp16ZeN7zK5uhadbPfAQsq38GMzJNWYG8g,6386
|
48
48
|
pyegeria/commands/cli/egeria_ops.py,sha256=8W4t2jFGn22OOOtyUAapQH8yyOl1wo09CVNTojRQKvo,12817
|
@@ -219,7 +219,7 @@ pyegeria/commands/tech/x_list_related_elements.py,sha256=ynaw792VnbMZ9IXBi5mmG7x
|
|
219
219
|
pyegeria/core_omag_server_config.py,sha256=pNQpocICkZx8sRsTw5DPUe-TFyxlIo1U88qqgci_f7I,97764
|
220
220
|
pyegeria/create_tech_guid_lists.py,sha256=hf5q8Xrdsz-bqeIW3yTORZ1XB6_BrKzLDWWwC_bNG2g,4811
|
221
221
|
pyegeria/egeria_cat_client.py,sha256=d8dQNPLzL4efi99OJfH1T-Rt1N0k9Rf9LX8LpuhiFls,2179
|
222
|
-
pyegeria/egeria_client.py,sha256=
|
222
|
+
pyegeria/egeria_client.py,sha256=HAM7pwH2ooegnpeaBr6Q0Km3zrzH1Mpgm0wgC82Y-DQ,4278
|
223
223
|
pyegeria/egeria_config_client.py,sha256=3TZUeXSl1f7SQ2WWYTbgOu1Cu1YqApilErAgjZLzbWY,1391
|
224
224
|
pyegeria/egeria_my_client.py,sha256=eOKLk2zdI6FHZnhAimfR_0yNdBjpUgD41dJZcJODcqE,1607
|
225
225
|
pyegeria/egeria_tech_client.py,sha256=uycgYfCpb4jzFfaQ7I5JxbZ5PKsWdaWxLOJjbw6C2Zk,3817
|
@@ -242,8 +242,8 @@ pyegeria/template_manager_omvs.py,sha256=PfJ9dOfmBvf59DgRdZ9Dl1Kl_UYqjF-JncXVnbC
|
|
242
242
|
pyegeria/utils.py,sha256=GCt1C0bp0Xng1ahzbZhzV9qQwH7Dj93IaCt2dvWb-sg,5417
|
243
243
|
pyegeria/valid_metadata_omvs.py,sha256=Xq9DqBQvBFFJzaFIRKcVZ2k4gJvSh9yeXs_j-O3vn1w,65050
|
244
244
|
pyegeria/x_action_author_omvs.py,sha256=RcqSzahUKCtvb_3u_wyintAlc9WFkC_2v0E12TZs8lQ,6433
|
245
|
-
pyegeria-5.3.6.
|
246
|
-
pyegeria-5.3.6.
|
247
|
-
pyegeria-5.3.6.
|
248
|
-
pyegeria-5.3.6.
|
249
|
-
pyegeria-5.3.6.
|
245
|
+
pyegeria-5.3.6.6.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
246
|
+
pyegeria-5.3.6.6.dist-info/METADATA,sha256=ialvs-DxLCrQU-TTXD9UZDS6mv917IEsjChoV6urAYw,2743
|
247
|
+
pyegeria-5.3.6.6.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
248
|
+
pyegeria-5.3.6.6.dist-info/entry_points.txt,sha256=-25SObCenvad7XXzMewoEnHVqXNwHOwEVfXHE12vBmI,6774
|
249
|
+
pyegeria-5.3.6.6.dist-info/RECORD,,
|
@@ -10,7 +10,7 @@ delete_glossary=pyegeria.commands.cat.glossary_actions:delete_glossary
|
|
10
10
|
delete_term=pyegeria.commands.cat.glossary_actions:delete_term
|
11
11
|
delete_todo=pyegeria.commands.my.todo_actions:delete_todo
|
12
12
|
dr_egeria_jupyter=pyegeria.commands.cat.dr_egeria_jupyter:process_jupyter_notebook
|
13
|
-
dr_egeria_md=pyegeria.commands.cat.dr_egeria_md:
|
13
|
+
dr_egeria_md=pyegeria.commands.cat.dr_egeria_md:main
|
14
14
|
egeria_login=pyegeria.commands.cli.egeria_login_tui:login
|
15
15
|
export_terms_to_csv_file=pyegeria.commands.cat.glossary_actions:export_terms_csv
|
16
16
|
get_asset_graph=pyegeria.commands.cat.get_asset_graph:main
|
File without changes
|
File without changes
|