pyegeria 5.4.0.dev7__py3-none-any.whl → 5.4.0.dev9__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.
- commands/cat/debug_log +5222 -0
- commands/cat/dr_egeria_md.py +9 -9
- commands/cat/glossary_actions.py +2 -2
- md_processing/data/commands.json +1216 -82
- md_processing/md_commands/data_designer_commands.py +22 -1
- md_processing/md_processing_utils/debug_log +0 -0
- md_processing/md_processing_utils/generated_help_terms.md +842 -0
- pyegeria/data_designer_omvs.py +2 -2
- pyegeria/glossary_manager_omvs.py +2 -2
- {pyegeria-5.4.0.dev7.dist-info → pyegeria-5.4.0.dev9.dist-info}/METADATA +1 -1
- {pyegeria-5.4.0.dev7.dist-info → pyegeria-5.4.0.dev9.dist-info}/RECORD +14 -11
- {pyegeria-5.4.0.dev7.dist-info → pyegeria-5.4.0.dev9.dist-info}/LICENSE +0 -0
- {pyegeria-5.4.0.dev7.dist-info → pyegeria-5.4.0.dev9.dist-info}/WHEEL +0 -0
- {pyegeria-5.4.0.dev7.dist-info → pyegeria-5.4.0.dev9.dist-info}/entry_points.txt +0 -0
commands/cat/dr_egeria_md.py
CHANGED
@@ -55,16 +55,16 @@ EGERIA_OUTBOX_PATH = os.environ.get("EGERIA_OUTBOX_PATH", "md_processing/dr_eger
|
|
55
55
|
|
56
56
|
|
57
57
|
@click.command("process_markdown_file", help="Process a markdown file and return the output as a string.")
|
58
|
-
@click.option("--file
|
58
|
+
@click.option("--input-file", help="Markdown file to process.", default="dr_egeria_intro_part1.md", required=True,
|
59
59
|
prompt=False)
|
60
|
-
@click.option("--directive", default="
|
60
|
+
@click.option("--directive", default="process", help="How to process the file",
|
61
61
|
type=click.Choice(["display", "validate", "process"], case_sensitive=False), prompt=False, )
|
62
62
|
@click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use.")
|
63
63
|
@click.option("--url", default=EGERIA_VIEW_SERVER_URL, help="URL of Egeria platform to connect to")
|
64
64
|
@click.option("--userid", default=EGERIA_USER, help="Egeria user")
|
65
65
|
@click.option("--user_pass", default=EGERIA_USER_PASSWORD, help="Egeria user password")
|
66
66
|
@logger.catch
|
67
|
-
def process_markdown_file(
|
67
|
+
def process_markdown_file(input_file: str, directive: str, server: str, url: str, userid: str, user_pass: str, ) -> None:
|
68
68
|
"""
|
69
69
|
Process a markdown file by parsing and executing Dr. Egeria md_commands. Write output to a new file.
|
70
70
|
"""
|
@@ -75,7 +75,7 @@ def process_markdown_file(file_path: str, directive: str, server: str, url: str,
|
|
75
75
|
token = client.create_egeria_bearer_token(userid, user_pass)
|
76
76
|
|
77
77
|
updated = False
|
78
|
-
full_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_INBOX_PATH,
|
78
|
+
full_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_INBOX_PATH, input_file)
|
79
79
|
logger.info("\n\n====================================================\n\n")
|
80
80
|
logger.info(f"Processing Markdown File: {full_file_path}")
|
81
81
|
try:
|
@@ -87,7 +87,7 @@ def process_markdown_file(file_path: str, directive: str, server: str, url: str,
|
|
87
87
|
|
88
88
|
final_output = []
|
89
89
|
prov_found = False
|
90
|
-
prov_output = (f"\n# Provenance\n\n* Results from processing file {
|
90
|
+
prov_output = (f"\n# Provenance\n\n* Results from processing file {input_file} on "
|
91
91
|
f"{datetime.now().strftime("%Y-%m-%d %H:%M")}\n")
|
92
92
|
h1_blocks = []
|
93
93
|
current_block = ""
|
@@ -104,7 +104,7 @@ def process_markdown_file(file_path: str, directive: str, server: str, url: str,
|
|
104
104
|
if potential_command in cmd_list:
|
105
105
|
# Process the block based on the object_action
|
106
106
|
if potential_command == "Provenance":
|
107
|
-
result = process_provenance_command(
|
107
|
+
result = process_provenance_command(input_file, current_block)
|
108
108
|
prov_found = True
|
109
109
|
|
110
110
|
elif potential_command in ["Create Glossary", "Update Glossary"]:
|
@@ -233,7 +233,7 @@ def process_markdown_file(file_path: str, directive: str, server: str, url: str,
|
|
233
233
|
|
234
234
|
try:
|
235
235
|
if updated:
|
236
|
-
path, filename = os.path.split(
|
236
|
+
path, filename = os.path.split(input_file) # Get both parts
|
237
237
|
new_filename = f"processed-{get_current_datetime_string()}-{filename}" # Create the new filename
|
238
238
|
new_file_path = os.path.join(EGERIA_ROOT_PATH, EGERIA_OUTBOX_PATH, new_filename) # Construct the new path
|
239
239
|
os.makedirs(os.path.dirname(new_file_path), exist_ok=True)
|
@@ -267,11 +267,11 @@ def process_markdown_file(file_path: str, directive: str, server: str, url: str,
|
|
267
267
|
# user_pass = args.password if args.password is not None else EGERIA_USER_PASSWORD
|
268
268
|
# time_out = args.time_out if args.time_out is not None else 60
|
269
269
|
# try:
|
270
|
-
#
|
270
|
+
# input_file = Prompt.ask("Markdown File name to process:", default="")
|
271
271
|
# directive = Prompt.ask("Processing Directive:", choices=[ "display", "validate", "process"],
|
272
272
|
# default="validate")
|
273
273
|
#
|
274
|
-
# process_markdown_file(
|
274
|
+
# process_markdown_file(input_file, directive, server, url, userid, user_pass)
|
275
275
|
# except KeyboardInterrupt:
|
276
276
|
# pass
|
277
277
|
#
|
commands/cat/glossary_actions.py
CHANGED
@@ -315,7 +315,7 @@ def remove_term_from_category(server, url, userid, password, timeout, term_guid,
|
|
315
315
|
@click.option("--glossary_name", help="Name of Glossary", required=True)
|
316
316
|
@click.option("--file_name", help="Name of CSV file", required=True)
|
317
317
|
@click.option(
|
318
|
-
"--
|
318
|
+
"--input_file", help="Path of CSV file", default=EGERIA_GLOSSARY_PATH, required=False
|
319
319
|
)
|
320
320
|
@click.option(
|
321
321
|
"--verbose",
|
@@ -380,7 +380,7 @@ def import_terms_csv(
|
|
380
380
|
)
|
381
381
|
@click.option("--file_name", help="Name of CSV file", required=True)
|
382
382
|
@click.option(
|
383
|
-
"--
|
383
|
+
"--input_file", help="Path of CSV file", default=EGERIA_GLOSSARY_PATH, required=False
|
384
384
|
)
|
385
385
|
@click.option("--server", default=EGERIA_VIEW_SERVER, help="Egeria view server to use")
|
386
386
|
@click.option(
|