pyegeria 5.3.6.2.5__py3-none-any.whl → 5.3.6.4__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.
Files changed (33) hide show
  1. pyegeria/__init__.py +3 -0
  2. pyegeria/_client.py +10 -0
  3. pyegeria/commands/cat/{freddie_jupyter.py → dr_egeria_jupyter.py} +8 -16
  4. pyegeria/commands/cat/{freddie_md.py → dr_egeria_md.py} +39 -33
  5. pyegeria/commands/cat/glossary_actions.py +59 -1
  6. pyegeria/commands/cat/list_categories.py +185 -0
  7. pyegeria/commands/cat/list_glossaries.py +26 -33
  8. pyegeria/commands/cat/list_terms.py +47 -47
  9. pyegeria/commands/cli/egeria.py +51 -29
  10. pyegeria/commands/cli/egeria_cat.py +53 -31
  11. pyegeria/create_tech_guid_lists.py +2 -5
  12. pyegeria/glossary_browser_omvs.py +283 -113
  13. pyegeria/glossary_manager_omvs.py +150 -1594
  14. pyegeria/md_processing_utils.py +853 -0
  15. {pyegeria-5.3.6.2.5.dist-info → pyegeria-5.3.6.4.dist-info}/METADATA +1 -1
  16. {pyegeria-5.3.6.2.5.dist-info → pyegeria-5.3.6.4.dist-info}/RECORD +21 -31
  17. {pyegeria-5.3.6.2.5.dist-info → pyegeria-5.3.6.4.dist-info}/entry_points.txt +5 -0
  18. pyegeria/commands/cat/freddie_jup.py +0 -124
  19. pyegeria/commands/cat/freddie_utils.py +0 -590
  20. pyegeria/commands/cat/freddies-inbox/freddie_intro.md +0 -221
  21. pyegeria/commands/cat/freddies-outbox/Terms-2025-03-06-13-19-29-Report.md +0 -69
  22. pyegeria/commands/cat/freddies-outbox/Terms-2025-03-06-13-20-30-Update-Form.md +0 -78
  23. pyegeria/commands/cat/freddies-outbox/Terms-2025-03-06-19-39-25-Update-Form.md +0 -78
  24. pyegeria/commands/cat/glossary_creation_experiment.ipynb +0 -235
  25. pyegeria/test_j.html +0 -0
  26. pyegeria/test_m.html +0 -213
  27. pyegeria/test_m1.html +0 -273
  28. pyegeria/test_mer.ipynb +0 -596
  29. pyegeria/test_w.html +0 -213
  30. /pyegeria/commands/cat/{freddies-inbox → dr_egeria_inbox}/glossary_creation_experiment.ipynb +0 -0
  31. /pyegeria/commands/cat/{freddies-inbox → dr_egeria_inbox}/glossary_exp.md +0 -0
  32. {pyegeria-5.3.6.2.5.dist-info → pyegeria-5.3.6.4.dist-info}/LICENSE +0 -0
  33. {pyegeria-5.3.6.2.5.dist-info → pyegeria-5.3.6.4.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyegeria
3
- Version: 5.3.6.2.5
3
+ Version: 5.3.6.4
4
4
  Summary: A python client for Egeria
5
5
  License: Apache 2.0
6
6
  Keywords: egeria,metadata,governance
@@ -1,6 +1,6 @@
1
1
  pyegeria/README.md,sha256=PwX5OC7-YSZUCIsoyHh1O-WBM2hE84sm3Bd4O353NOk,1464
2
- pyegeria/__init__.py,sha256=AYS0IpQrtlb5uKmOn-bGaL3iPYzdpg1on3CSquenyPM,29899
3
- pyegeria/_client.py,sha256=aeyB27WFxswxcIj_Ky88F2Q4S5zn7ofmux65aen5mW0,31130
2
+ pyegeria/__init__.py,sha256=08v01IyeVZ-YlRZU0qGPAGDhNsdEscX1IHvPcsAYZrE,30187
3
+ pyegeria/_client.py,sha256=nhUPmeQFHqbobM6_3EGmUy-STYURxb15BEXf6erY2oI,31733
4
4
  pyegeria/_deprecated_gov_engine.py,sha256=dWNcwVsE5__dF2u4QiIyQrssozzzOjBbLld8MdpmVCQ,17264
5
5
  pyegeria/_exceptions.py,sha256=1SrnV194V4_YJNnNAU0myTHQ3dhLn4GF2B2gZcj1u90,18153
6
6
  pyegeria/_globals.py,sha256=a_irI6oGuBLks2LzQHkSdK6xWbPdJCPRjqxK7PKxwgw,991
@@ -13,41 +13,35 @@ pyegeria/commands/README.md,sha256=hJdOWhZ5eCfwTkY4Tx6De6Y1XVo7cbaddQEvjqppvls,2
13
13
  pyegeria/commands/__init__.py,sha256=R2o66ctVicTZ8B5VSPtc7EDRKNiNclzFbYX0o2Zg2dQ,1120
14
14
  pyegeria/commands/cat/README.md,sha256=-aaAnIT2fcfU63vajgB-RzQk4l4yFdhkyVfSaTPiqRY,967
15
15
  pyegeria/commands/cat/__init__.py,sha256=5OCy4m_yZsnSxdy_gvkCyP_OkjvuWKimqUGHYCJc_qA,450
16
+ pyegeria/commands/cat/dr_egeria_inbox/glossary_creation_experiment.ipynb,sha256=dbzNu90fCKNohOWVSRBOB1GLyd95x8Qw51I5AkaPtso,11552
17
+ pyegeria/commands/cat/dr_egeria_inbox/glossary_exp.md,sha256=KsUeTzDe5QkrTmIfIAXR74qZ29oSfRW-NAEn0RYIRqM,2534
18
+ pyegeria/commands/cat/dr_egeria_jupyter.py,sha256=4LcmD5CrtazLgUK_LCjgOnwtxZqTBB6lrMR8tsugl94,6036
19
+ pyegeria/commands/cat/dr_egeria_md.py,sha256=jMioOrViTFuExh8AlFpJvrEZt4U5I9oUICvKhQPx4D0,7675
16
20
  pyegeria/commands/cat/exp_list_glossaries.py,sha256=dC6Bnfm3YSMTKPP146qeslIFRiZnGu5b7iDYE07p4iU,5817
17
- pyegeria/commands/cat/freddie_jup.py,sha256=zSuV8kiAGvOVBPnaln-dIY2T03hWQN2HeoLhkodayAo,5686
18
- pyegeria/commands/cat/freddie_jupyter.py,sha256=3-Z_pzOQUiBIBHtpQTrQhKyM3DmKHmyvsTpEcoju-y0,6195
19
- pyegeria/commands/cat/freddie_md.py,sha256=vueJ7OahPt5t4OW8eT9JbE7n5kEoU1bLHlnvEStmo8o,7087
20
- pyegeria/commands/cat/freddie_utils.py,sha256=r7e1EaUouwAY4sc4VjIr6xtknkhq4wz-UncyWW04IBk,26742
21
- pyegeria/commands/cat/freddies-inbox/freddie_intro.md,sha256=2HGuA2xsRpwqxDtG59iD4hDdCkyHcqE-OhXCT1KgeW8,6512
22
- pyegeria/commands/cat/freddies-inbox/glossary_creation_experiment.ipynb,sha256=dbzNu90fCKNohOWVSRBOB1GLyd95x8Qw51I5AkaPtso,11552
23
- pyegeria/commands/cat/freddies-inbox/glossary_exp.md,sha256=KsUeTzDe5QkrTmIfIAXR74qZ29oSfRW-NAEn0RYIRqM,2534
24
- pyegeria/commands/cat/freddies-outbox/Terms-2025-03-06-13-19-29-Report.md,sha256=nvwc4CxfCylURRZHhHrYthEYhGkiV6huOTct0tV7xRE,1981
25
- pyegeria/commands/cat/freddies-outbox/Terms-2025-03-06-13-20-30-Update-Form.md,sha256=FKBOoF4VQCta8IzjuPPsJ12THr7_dUszFAmsD48MrIY,2046
26
- pyegeria/commands/cat/freddies-outbox/Terms-2025-03-06-19-39-25-Update-Form.md,sha256=egPZERg6CleKgHuQX10Z1Izj-YSCXBhrPm-wKUC6ua0,2046
27
21
  pyegeria/commands/cat/get_asset_graph.py,sha256=xnXJfpDTVH1TJ2TwE3dtjaXU36Di6-N6JAyhothzz2o,12461
28
22
  pyegeria/commands/cat/get_collection.py,sha256=KbSFoGZeK30_bMCa0BpIuCwBF5ywCX0g4hgDPnI0lEo,5356
29
23
  pyegeria/commands/cat/get_project_dependencies.py,sha256=wDK_lAfR6p4VxYRV6MZE9XgU3OfIRcWKKYn0Xf64w6o,5986
30
24
  pyegeria/commands/cat/get_project_structure.py,sha256=4Jo3F9f7auTnTt_xElsrQ4eA8k8xMge0C5xE-Rjkjcw,5974
31
25
  pyegeria/commands/cat/get_tech_type_elements.py,sha256=IznytHXwDOFriGM6mypV9wuEeM-vT2s66cUzf-IROog,6147
32
- pyegeria/commands/cat/glossary_actions.py,sha256=P530QqaYsv3HVVqjJYfwjuTqYOTqWtkcRb8ySFw8hI4,16755
33
- pyegeria/commands/cat/glossary_creation_experiment.ipynb,sha256=iyXV1dlabCAoUViMVFzOPGBpgs2DA-2d5QWWCfubXWk,6689
26
+ pyegeria/commands/cat/glossary_actions.py,sha256=q3MusBFCrIqQW6feGrrOv1MAmzIZ68Kl99IVc2393og,19427
34
27
  pyegeria/commands/cat/list_assets.py,sha256=CdJ2coKvvQv2VwJO0Sp9Eg9Fu_uvpC21tgjrdtT9Yz4,6315
28
+ pyegeria/commands/cat/list_categories.py,sha256=VYZwQC9vezyGFm5dowD-aVszSKlS2MYo7d1KftdbycU,7595
35
29
  pyegeria/commands/cat/list_cert_types.py,sha256=HmrTks0SSYgSMsYz3LqfX5kwDQ6D9KMcynoR_xlWtnE,7137
36
30
  pyegeria/commands/cat/list_collections.py,sha256=kCxl5OuBAGtctHNVmttOe4aJ6r37cGdCFnK1i7A90ls,5996
37
31
  pyegeria/commands/cat/list_deployed_catalogs.py,sha256=VdN6R9kRVWX-fGIgubOigvMVPzhF-hKQepHHlS-w-D8,8258
38
32
  pyegeria/commands/cat/list_deployed_database_schemas.py,sha256=1Qicke1R2_7Xi3Qf5sp8KJ3_reAIt0z1iaz2sG8Z0Qs,9458
39
33
  pyegeria/commands/cat/list_deployed_databases.py,sha256=ryrBW1CxJRfOeLP978qQwxb5oImqhIsHghtcpWeBIrw,7587
40
34
  pyegeria/commands/cat/list_deployed_servers.py,sha256=_xR7EaaCsxIjTphxmoCZlARoja_vQqZ881pFiEuhw-8,5719
41
- pyegeria/commands/cat/list_glossaries.py,sha256=9lLYeu1Q99Y4xGghTv40hiraWZfWpHe0tZONN197bUY,7736
35
+ pyegeria/commands/cat/list_glossaries.py,sha256=jlhe840GxadFVM2qIcVm7-YwZ-8EBN-aCqDGIXlsdBw,7296
42
36
  pyegeria/commands/cat/list_projects.py,sha256=NzWTuepTGUEyxK-eWvuUxtBgCtNWubVwmz2eqm2UN1c,7997
43
37
  pyegeria/commands/cat/list_tech_type_elements.py,sha256=-9omj5en9dSP1xMSljYVHyfXsuhuE1bO2IFj_bZPhAs,6873
44
38
  pyegeria/commands/cat/list_tech_types.py,sha256=uqZcXHCzAznhEG6WWeM5j-spwUh8ycygFqpVDeXOG-0,4653
45
- pyegeria/commands/cat/list_terms.py,sha256=WPqd5bWm_Re-NlR_OLtekmj8m2UX_8vIo9AJDKMVR_M,11942
39
+ pyegeria/commands/cat/list_terms.py,sha256=D0tCD2f8j-UgnV4Bgisj9a11CCEOneNsRT7_3cyDnH4,12098
46
40
  pyegeria/commands/cat/list_todos.py,sha256=NitCw0uyVVjmN1hxb1W-I4FbOsa8wQxW2ICyOElHyc8,6556
47
41
  pyegeria/commands/cat/list_user_ids.py,sha256=X5Q-YNEp38saPYDuy9VwdQC5Qpa4HyC3WvAdbyp_P6M,5108
48
42
  pyegeria/commands/cli/__init__.py,sha256=hpTVSMP2gnPRhcAZPdeUEsQ-eaDySlXlk239dNWYmng,292
49
- pyegeria/commands/cli/egeria.py,sha256=vVB7RY4oOb43qIagBD65_xAed8QKBEUX_hiI6js8NGU,51622
50
- pyegeria/commands/cli/egeria_cat.py,sha256=9UYmHwS1vaepUGIk5jSe5WVfG2VZMyyzxw6L_99u1ak,17241
43
+ pyegeria/commands/cli/egeria.py,sha256=Rtqru3Dp61SspzMVQ_UMHhtPc4_kq7S3Ocf-SqdfTN0,52635
44
+ pyegeria/commands/cli/egeria_cat.py,sha256=_1qA7PS3fMH22j9BTGqFLnqVOTMRewP8-6jIPBvjuCI,18237
51
45
  pyegeria/commands/cli/egeria_login_tui.py,sha256=W5ouG3nlN7z2Waa-wzYFS7yyoGfOrK-lNB0FMt2JdOk,9492
52
46
  pyegeria/commands/cli/egeria_my.py,sha256=0KTH7OIeKyp16ZeN7zK5uhadbPfAQsq38GMzJNWYG8g,6386
53
47
  pyegeria/commands/cli/egeria_ops.py,sha256=8W4t2jFGn22OOOtyUAapQH8yyOl1wo09CVNTojRQKvo,12817
@@ -222,7 +216,7 @@ pyegeria/commands/tech/list_valid_metadata_values.py,sha256=_zgOdq2N6s7GjLd8iEc5
222
216
  pyegeria/commands/tech/table_tech_templates.py,sha256=jI1c9YKa3KirArMNXeCRKeaiVdwQSN-ztPqkag6jdZs,9500
223
217
  pyegeria/commands/tech/x_list_related_elements.py,sha256=ynaw792VnbMZ9IXBi5mmG7xBfC0kn0esKiFTsjvLGzc,5900
224
218
  pyegeria/core_omag_server_config.py,sha256=pNQpocICkZx8sRsTw5DPUe-TFyxlIo1U88qqgci_f7I,97764
225
- pyegeria/create_tech_guid_lists.py,sha256=ngd7mOYIOfXmKCnYfIKCVqwdmoxQeEL9bGncxkTTs9Q,4925
219
+ pyegeria/create_tech_guid_lists.py,sha256=hf5q8Xrdsz-bqeIW3yTORZ1XB6_BrKzLDWWwC_bNG2g,4811
226
220
  pyegeria/egeria_cat_client.py,sha256=d8dQNPLzL4efi99OJfH1T-Rt1N0k9Rf9LX8LpuhiFls,2179
227
221
  pyegeria/egeria_client.py,sha256=RxD-iU2SiUcWG-c3I2M4dSDGBgE9oCK40edJ4kKfm3w,4135
228
222
  pyegeria/egeria_config_client.py,sha256=3TZUeXSl1f7SQ2WWYTbgOu1Cu1YqApilErAgjZLzbWY,1391
@@ -230,9 +224,10 @@ pyegeria/egeria_my_client.py,sha256=eOKLk2zdI6FHZnhAimfR_0yNdBjpUgD41dJZcJODcqE,
230
224
  pyegeria/egeria_tech_client.py,sha256=uycgYfCpb4jzFfaQ7I5JxbZ5PKsWdaWxLOJjbw6C2Zk,3817
231
225
  pyegeria/feedback_manager_omvs.py,sha256=0xBs0p54vmdfVYYgQ8pOanLC4fxfgTk1Z61Y6D1U7_I,152978
232
226
  pyegeria/full_omag_server_config.py,sha256=CQqLCy_3DZFvJZEOcGf50HWdFaWpiAIs6z-kKyjvpDA,47464
233
- pyegeria/glossary_browser_omvs.py,sha256=55HguIU4ypbwLOZqHZRspUeeEaMIEc-riIctPHHH7Rw,99554
234
- pyegeria/glossary_manager_omvs.py,sha256=BM54pCQBpzxry4nHUpPQ56kI1W864toHevTEZ6RckLE,126957
227
+ pyegeria/glossary_browser_omvs.py,sha256=r8PYlNTN-Ej2pGg1SigKQn8Qu1wDmFvWG5vM2I12JyI,109391
228
+ pyegeria/glossary_manager_omvs.py,sha256=QSOVqbwEASueCQzpvYNEOaUIAhOvwqLWWhfzwT8hrrs,70275
235
229
  pyegeria/m_test.py,sha256=M5-M2ZczsAJLXWfSeqTTADHdx6Ku-y4PbQ4M21JthAE,7778
230
+ pyegeria/md_processing_utils.py,sha256=FiZqeN39YH9LeZvzY_YZ8wo6DnRRvQif3-BBHLebcBg,40329
236
231
  pyegeria/mermaid_utilities.py,sha256=sQqdFUWdNpHu9d3Tk9UVe80M-5bOzses0XcFYX5FF-E,54254
237
232
  pyegeria/metadata_explorer_omvs.py,sha256=xHnZTQKbd6XwOhYia-RiIisrvZcqHi0SL1l6OCf04Gk,86911
238
233
  pyegeria/my_profile_omvs.py,sha256=d0oJYCJG7pS9BINPuGciVa00ac0jwPHNANXDCLginEc,34720
@@ -243,16 +238,11 @@ pyegeria/runtime_manager_omvs.py,sha256=Z5wY9ignNjil8O6yjihZftxkGoh9A4PQDcXhoIsO
243
238
  pyegeria/server_operations.py,sha256=5k0KVz3u8qRLwtz16zT3J86LZY3pkUrMDcps8srmq1A,16831
244
239
  pyegeria/solution_architect_omvs.py,sha256=x6CfPTyn1l2DFYVEFP0t_rT9uVjoFr596hBBeuVaMRg,22093
245
240
  pyegeria/template_manager_omvs.py,sha256=PfJ9dOfmBvf59DgRdZ9Dl1Kl_UYqjF-JncXVnbCqLZU,42408
246
- pyegeria/test_j.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
247
- pyegeria/test_m.html,sha256=q9HCstV2Ar-QiAqswte6hQ8EJuKqr5s99MUuXSxs7a8,11461
248
- pyegeria/test_m1.html,sha256=XS_1IAtfG4ZlZk45QTkrFWWpjQMVlO21ScDMX2Frl3g,14086
249
- pyegeria/test_mer.ipynb,sha256=G7hpHn07IXnt_VKvnTDvljwwHB7RfC0etOMyZKt1icQ,30809
250
- pyegeria/test_w.html,sha256=q9HCstV2Ar-QiAqswte6hQ8EJuKqr5s99MUuXSxs7a8,11461
251
241
  pyegeria/utils.py,sha256=GCt1C0bp0Xng1ahzbZhzV9qQwH7Dj93IaCt2dvWb-sg,5417
252
242
  pyegeria/valid_metadata_omvs.py,sha256=Xq9DqBQvBFFJzaFIRKcVZ2k4gJvSh9yeXs_j-O3vn1w,65050
253
243
  pyegeria/x_action_author_omvs.py,sha256=RcqSzahUKCtvb_3u_wyintAlc9WFkC_2v0E12TZs8lQ,6433
254
- pyegeria-5.3.6.2.5.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
255
- pyegeria-5.3.6.2.5.dist-info/METADATA,sha256=iadEy3TJ8gFSedPKTRuV95ULy7hiWXrcSjC1YYe9aho,2745
256
- pyegeria-5.3.6.2.5.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
257
- pyegeria-5.3.6.2.5.dist-info/entry_points.txt,sha256=9LIuEBIFodyDPNWxZFCJNSzK7-ZS85Kes3eTTYTGWHo,6407
258
- pyegeria-5.3.6.2.5.dist-info/RECORD,,
244
+ pyegeria-5.3.6.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
245
+ pyegeria-5.3.6.4.dist-info/METADATA,sha256=yd4UPOQI1S90JJ0hO89N5EIKSu6t5CvWuywJ9c4PFh4,2743
246
+ pyegeria-5.3.6.4.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
247
+ pyegeria-5.3.6.4.dist-info/entry_points.txt,sha256=eAvQ_vkejlF3JzMzEc5VD93ymLA_hSFV0HM8fntG-d8,6791
248
+ pyegeria-5.3.6.4.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  [console_scripts]
2
+ add_term_to_category=pyegeria.commands.cat.glossary_actions:add_term_to_category
2
3
  change_todo_status=pyegeria.commands.my.todo_actions:change_todo_status
3
4
  create_category=pyegeria.commands.cat.glossary_actions:create_category
4
5
  create_glossary=pyegeria.commands.cat.glossary_actions:create_glossary
@@ -8,6 +9,8 @@ delete_category=pyegeria.commands.cat.glossary_actions:delete_category
8
9
  delete_glossary=pyegeria.commands.cat.glossary_actions:delete_glossary
9
10
  delete_term=pyegeria.commands.cat.glossary_actions:delete_term
10
11
  delete_todo=pyegeria.commands.my.todo_actions:delete_todo
12
+ dr_egeria_jupyter=pyegeria.commands.cat.dr_egeria_jupyter:process_jupyter_notebook
13
+ dr_egeria_md=pyegeria.commands.cat.dr_egeria_md:process_markdown_file
11
14
  egeria_login=pyegeria.commands.cli.egeria_login_tui:login
12
15
  export_terms_to_csv_file=pyegeria.commands.cat.glossary_actions:export_terms_csv
13
16
  get_asset_graph=pyegeria.commands.cat.get_asset_graph:main
@@ -30,6 +33,7 @@ list_archives=pyegeria.commands.ops.list_archives:main
30
33
  list_asset_types=pyegeria.commands.tech.list_asset_types:main
31
34
  list_assets=pyegeria.commands.cat.list_assets:main
32
35
  list_catalog_targets=pyegeria.commands.ops.list_catalog_targets:main
36
+ list_categories=pyegeria.commands.cat.list_categories:main
33
37
  list_cert_types=pyegeria.commands.cat.list_cert_types:main
34
38
  list_collections=pyegeria.commands.cat.list_collections:main
35
39
  list_deployed_catalogs=pyegeria.commands.cat.list_deployed_catalogs:main
@@ -86,6 +90,7 @@ monitor_server_status=pyegeria.commands.ops.monitor_server_status:main
86
90
  reassign_todo=pyegeria.commands.my.todo_actions:reassign_todo
87
91
  refresh_gov_eng_config=pyegeria.commands.ops.gov_server_actions:refresh_gov_eng_config
88
92
  refresh_integration_daemon=pyegeria.commands.ops.refresh_integration_daemon:main
93
+ remove_term_from_category=pyegeria.commands.cat.glossary_actions:remove_term_from_category
89
94
  restart_integration_daemon=pyegeria.commands.ops.restart_integration_daemon:main
90
95
  start_daemon=pyegeria.commands.ops.engine_actions:start_daemon
91
96
  stop_daemon=pyegeria.commands.ops.engine_actions:stop_daemon
@@ -1,124 +0,0 @@
1
- """
2
- This is an ongoing experiment in parsing and playing with Freddie docs
3
- """
4
- import json
5
- import marko
6
- from jupyter_notebook_parser import JupyterNotebookParser
7
- import nbformat
8
- import os
9
- import re
10
- from pyegeria import EgeriaTech
11
- from rich import box, print
12
- from rich.console import Console
13
- from rich.markdown import Markdown
14
- from rich.prompt import Prompt
15
- from rich.table import Table
16
- from freddie_utils import (extract_command, process_glossary_upsert_command, process_term_upsert_command,
17
- get_current_datetime_string)
18
-
19
- import click
20
- from pyegeria import EgeriaTech, body_slimmer, NO_GLOSSARIES_FOUND, NO_TERMS_FOUND, NO_ELEMENTS_FOUND
21
- from pyegeria._exceptions import (
22
- InvalidParameterException,
23
- PropertyServerException,
24
- print_exception_response,
25
- )
26
- import datetime
27
-
28
- EGERIA_METADATA_STORE = os.environ.get("EGERIA_METADATA_STORE", "active-metadata-store")
29
- EGERIA_KAFKA_ENDPOINT = os.environ.get("KAFKA_ENDPOINT", "localhost:9092")
30
- EGERIA_PLATFORM_URL = os.environ.get("EGERIA_PLATFORM_URL", "https://localhost:9443")
31
- EGERIA_VIEW_SERVER = os.environ.get("EGERIA_VIEW_SERVER", "view-server")
32
- EGERIA_VIEW_SERVER_URL = os.environ.get(
33
- "EGERIA_VIEW_SERVER_URL", "https://localhost:9443"
34
- )
35
- EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon")
36
- EGERIA_INTEGRATION_DAEMON_URL = os.environ.get(
37
- "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443"
38
- )
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_WIDTH = os.environ.get("EGERIA_WIDTH", 220)
44
- EGERIA_JUPYTER = os.environ.get("EGERIA_JUPYTER", False)
45
- EGERIA_HOME_GLOSSARY_GUID = os.environ.get("EGERIA_HOME_GLOSSARY_GUID", None)
46
- EGERIA_GLOSSARY_PATH = os.environ.get("EGERIA_GLOSSARY_PATH", None)
47
- EGERIA_ROOT_PATH = os.environ.get("EGERIA_ROOT_PATH", "/Users/dwolfson/localGit/egeria-v5-3/egeria-workspaces")
48
- EGERIA_FREDDIE_INBOX_PATH = os.environ.get("EGERIA_FREDDIE_INBOX_PATH", "exchange/loading-bay/freddies-inbox")
49
- EGERIA_FREDDIE_OUTBOX_PATH = os.environ.get("EGERIA_FREDDIE_OUTBOX_PATH", "exchange/distribution-hub/freddies-outbox")
50
- commands = ["Create Glossary", "Create Term", "Create Governance Definition", "Update Term"]
51
- console = Console(width=int(EGERIA_WIDTH))
52
-
53
-
54
-
55
- @click.command("process-jupyter")
56
- @click.option("--file-path", help="File path to notebook",
57
- default="glossary_creation_experiment.ipynb")
58
- @click.option("--directive", default="display-only", help="How to process the file")
59
- @click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use.")
60
- @click.option(
61
- "--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to"
62
- )
63
- @click.option("--userid", default=EGERIA_USER, help="Egeria user")
64
- @click.option("--user_pass", default=EGERIA_USER_PASSWORD, help="Egeria user password")
65
- def process_jupyter_notebook(
66
- file_path: str,
67
- directive: str,
68
- server: str,
69
- url: str,
70
- userid: str,
71
- user_pass: str,
72
- ):
73
- client = EgeriaTech(server, url, user_id=userid)
74
- token = client.create_egeria_bearer_token(userid, user_pass)
75
- #
76
- # parsed_notebook = JupyterNotebookParser(file_path)
77
- #
78
- # cell_sources = parsed_notebook.get_markdown_cell_sources()
79
- try:
80
- updated = False
81
- full_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_FREDDIE_INBOX_PATH, file_path)
82
- click.echo(f"Processing notebook: {full_file_path}")
83
- with open(full_file_path, 'r') as f:
84
- nb = nbformat.read(f, as_version=4)
85
- for cell in nb.cells:
86
- if cell.cell_type == 'markdown':
87
- if cell.source.strip().startswith('#'):
88
- potential_command = extract_command(cell.source)
89
- if potential_command in commands:
90
- if potential_command in ["Create Glossary", "Update Glossary"]:
91
- result = process_glossary_upsert_command(client, cell.source, directive)
92
- if result:
93
- if directive == "process":
94
- updated = True
95
- cell.source = result
96
- else:
97
- continue
98
- if potential_command in ["Create Term", "Update Term"]:
99
- result = process_term_upsert_command(client, cell.source, directive)
100
- if result:
101
- if directive == "process":
102
- updated = True
103
- cell.source = result
104
- else:
105
- continue
106
-
107
- if updated:
108
- path, filename = os.path.split(file_path) # Get both parts
109
- new_filename = f"processed-{get_current_datetime_string()}-{filename}" # Create the new filename
110
- new_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_FREDDIE_OUTBOX_PATH, new_filename) # Construct the new path
111
- os.makedirs(os.path.dirname(new_file_path), exist_ok=True)
112
-
113
-
114
- with open(new_file_path, 'w') as f2:
115
- nbformat.write(nb, f2)
116
- click.echo(f"\n==>Notebook written to {new_file_path}")
117
-
118
- except Exception as e:
119
- print_exception_response(e)
120
- return
121
-
122
-
123
- if __name__ == "__main__":
124
- process_jupyter_notebook()