From b0f37b8e7f3ebbacdd7ad60f4f00b9b071b61d65 Mon Sep 17 00:00:00 2001 From: chasserb Date: Sun, 1 Oct 2023 19:20:47 -0400 Subject: [PATCH 1/7] Rename to a more meaningful name --- Validation/validate.py | 206 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 Validation/validate.py diff --git a/Validation/validate.py b/Validation/validate.py new file mode 100644 index 0000000..3f69ddf --- /dev/null +++ b/Validation/validate.py @@ -0,0 +1,206 @@ +""" +-------------------------------- UNDER DEVELOPMENT ----------------------------------------- + +""" + +import re +import os +import subprocess +import click +import pandas as pd +import numpy as np +import json +import platform + +REPORT_FILE = 'Report.txt' + +def open_report(file_path): + with open(REPORT_FILE, 'a') as file: + file.write(file_path) + +def analyze_file(file_path): + file_extension = os.path.splitext(file_path)[1].lower() + size = os.path.getsize(file_path) + + open_report('************ VALIDATION REPORT OF UPLOADED FILE ************') + open_report(f'FILE TYPE: {file_extension.upper()}') + open_report(f'FILE SIZE: {size/1000} KB') + + if file_extension == '.csv': + classify_csv(file_path) + count_null_blank(file_path) + elif file_extension == '.json': + classify_json(file_path) + elif file_extension == '.txt': + classify_text(file_path) + else: + open_report('FILE TYPE: UNKNOWN') + + +def classify_text(file_path): + numeric_count = 0 + text_count = 0 + + with open(file_path, 'r') as file: + for line in file: + line = line.strip() + numeric_pattern = r'^[0-9]+$' + if re.match(numeric_pattern, line): + numeric_count += 1 + else: + text_count += 1 + + open_report(f'Ratio for Text Token to Numeric Token is: {text_count} : {numeric_count}\n') + + +def classify_csv(file_path): + df = pd.read_csv(file_path) + + numeric_columns = 0 + text_columns = 0 + + for column in df.columns: + if pd.to_numeric(df[column], errors='coerce').notnull().all(): + numeric_columns += 1 + else: + text_columns += 1 + + open_report(f'Ratio for Text column to Numeric column is: {text_columns} : {numeric_columns}\n') + +def classify_json(file_path): + with open(file_path, 'r') as file: + data = json.load(file) + + numeric_count = 0 + text_count = 0 + + def check_type(value): + if isinstance(value, (int, float)) or (isinstance(value, str) and value.isdigit()): + return 'Numeric' + else: + return 'Text' + + def iterate_json(obj): + nonlocal numeric_count, text_count + if isinstance(obj, dict): + for key, value in obj.items(): + if isinstance(value, (dict, list)): + iterate_json(value) + else: + type_result = check_type(value) + if type_result == 'Numeric': + numeric_count += 1 + else: + text_count += 1 + elif isinstance(obj, list): + for item in obj: + if isinstance(item, (dict, list)): + iterate_json(item) + else: + type_result = check_type(item) + if type_result == 'Numeric': + numeric_count += 1 + else: + text_count += 1 + + iterate_json(data) + open_report(f'Ratio for Text Object to Numeric Object is : {text_count} : {numeric_count}\n\n') + + +def count_null_blank(csv_file): + df = pd.read_csv(csv_file) + column_stats = [] + + for column in df.columns: + null_count = df[column].isnull().sum() + blank_count = df[column].map(lambda x: str(x).strip() == '').sum() + data_type = df[column].dtype + q1=median=q3=iqr=bias=skewness=skew=0 + if data_type=='int64'or data_type=='float64': + values = df[column].dropna() + sorted_values = np.sort(values) + no_of_values = len(sorted_values) + q1_index = int(0.25 * (no_of_values + 1)) + q3_index = int(0.75 * (no_of_values + 1)) + if(q1_index!=0 or q3_index!=0): + q1 = sorted_values[q1_index - 1] + q3 = sorted_values[q3_index - 1] + iqr = q3 - q1 + bias = (q3 - q1) / (q3 + q1) + median = np.median(values) #q2 + skewness = 3 * (median - np.mean(values)) / np.std(values) + if((q3-median)<(median-q1)): + skew="Negative Skew" + else: + skew="Positive Skew" + column_stats.append((column, null_count, blank_count, data_type,q1,median,q3,iqr,bias,skewness,skew)) + + + open_report('------ COLUMN WISE ANALYSIS ------\n') + for column, null_count, blank_count, data_type,q1,median,q3,iqr,bias,skewness,skew in column_stats: + open_report(f'Column Name : {column}\n') + open_report(f'Number of Null Values : {null_count}\n') + open_report(f'Number of Blank Values : {blank_count}\n') + open_report(f'Data type of column : {data_type}\n') + open_report(f'Quartile 1 Value : {q1}\n') + open_report(f'Quartile 2 Value : {median}\n') + open_report(f'Quartile 3 Value : {q3}\n') + open_report(f'InterQuartile Range : {iqr}\n') + open_report(f'Bias : {bias}\n') + open_report(f'Skewness Value: {skewness}\n') + open_report(f'Skew Result : {skew}\n') + open_report('---\n\n') + + +def main(): + current_directory = os.getcwd() # Get the current directory + file_list = os.listdir(current_directory) # List files in the current directory + + # Filter the list to include only CSV and JSON files + valid_extensions = ('.csv', '.json') + valid_files = [file for file in file_list if file.endswith(valid_extensions)] + + # List the valid files + if valid_files: + print("Available CSV and JSON files in the current directory:") + for i, file_name in enumerate(valid_files, start=1): + print(f"{i}. {file_name}") + + # Enter the number assigned to the file + selection = click.prompt("Enter the number of the file to analyze", type=int) + + if 1 <= selection <= len(valid_files): + selected_file = valid_files[selection - 1] + file_path = os.path.join(current_directory, selected_file) + + with open('Report.txt', 'w') as report_file: + report_file.write('') + analyze_file(file_path) + with open('Report.txt', 'a') as report_file: + report_file.write('\n\n\nREMARKS:\n') + report_file.write('\tThe Quartile, Bias, and Skewness are only calculated for Numeric Columns and No Null and No Blank Columns.\n') + report_file.write('\nNOTE: *This is an AutoGenerated Analysis Report, the Values May Differ by the method of calculation and file neatness\n') + report_file.write("\t@ DATA STOREHOUSE\n") + print("The Report is updated in 'Report.txt' file...") + + ''' + Automatically open the 'Report.txt' file with the default text editor. + Also, we need to check what the users operating system is so subprocess can open the correct shell. + - Darwin: macOS + - xdg-open: Linux and other + ''' + if platform.system() == 'Darwin': + subprocess.run(['open', 'Report.txt']) + elif platform.system() == 'Windows': + subprocess.run(['start', 'Report.txt'], shell=True) + else: + subprocess.run(['xdg-open', 'Report.txt']) + + else: + print("Invalid selection.") + else: + print("No CSV or JSON files found in the current directory.") + +if __name__ == "__main__": + main() + From 93fd377dbcc282386dbd465ef786053915aed696 Mon Sep 17 00:00:00 2001 From: chasserb Date: Sun, 1 Oct 2023 19:21:48 -0400 Subject: [PATCH 2/7] No longer needed --- Validation/Main.py | 175 --------------------------------------------- 1 file changed, 175 deletions(-) delete mode 100644 Validation/Main.py diff --git a/Validation/Main.py b/Validation/Main.py deleted file mode 100644 index 0d70765..0000000 --- a/Validation/Main.py +++ /dev/null @@ -1,175 +0,0 @@ -""" --------------------------------- UNDER DEVELOPMENT ----------------------------------------- - -""" - -import re -import os -import pandas as pd -import numpy as np -import json - -def file_type(file_path): - file_extension = os.path.splitext(file_path)[1].lower() - size = os.path.getsize(file_path) - with open(report_file, 'a') as file: - file.write('\t\t\t\t************ VALIDATION REPORT OF UPLOADED FILE ************ \n\n') - - if file_extension == '.csv': - with open(report_file, 'a') as file: - file.write('FILE TYPE : CSV \n') - file.write(f'FILE SIZE : {size/1000} KB\n') - classify_csv(file_path) - count_null_blank(file_path) - - elif file_extension == '.json': - with open(report_file, 'a') as file: - file.write('FILE TYPE : JSON \n') - file.write(f'FILE SIZE : {size/1000} KB\n') - classify_json(file_path) - - elif file_extension == '.txt': - with open(report_file, 'a') as file: - file.write('FILE TYPE : TXT \n') - file.write(f'FILE SIZE : {size/1000} KB\n') - classify_text(file_path) - - else: - with open(report_file, 'a') as file: - file.write('FILE TYPE : UNKNOWN \n') - file.write(f'FILE SIZE : {size/1000} KB\n') - -def classify_text(file_path): - numeric_count = 0 - text_count = 0 - - with open(file_path, 'r') as file: - for line in file: - line = line.strip() - numeric_pattern = r'^[0-9]+$' - if re.match(numeric_pattern, line): - numeric_count += 1 - else: - text_count += 1 - - # if numeric_count > text_count: - # return 'Numeric' - # else: - # return 'Text' - with open(report_file, 'a') as file: - file.write(f'Ratio for Text Token to Numeric Token is : {text_count} : {numeric_count}\n\n') - - -def classify_csv(file_path): - df = pd.read_csv(file_path) - - numeric_columns = 0 - text_columns = 0 - - for column in df.columns: - if pd.to_numeric(df[column], errors='coerce').notnull().all(): - numeric_columns += 1 - else: - text_columns += 1 - - with open(report_file, 'a') as file: - file.write(f'Ratio for Text column to Numeric column is : {text_columns} : {numeric_columns}\n\n') - -def classify_json(file_path): - with open(file_path, 'r') as file: - data = json.load(file) - - numeric_count = 0 - text_count = 0 - - def check_type(value): - if isinstance(value, (int, float)) or (isinstance(value, str) and value.isdigit()): - return 'Numeric' - else: - return 'Text' - - def iterate_json(obj): - nonlocal numeric_count, text_count - if isinstance(obj, dict): - for key, value in obj.items(): - if isinstance(value, (dict, list)): - iterate_json(value) - else: - type_result = check_type(value) - if type_result == 'Numeric': - numeric_count += 1 - else: - text_count += 1 - elif isinstance(obj, list): - for item in obj: - if isinstance(item, (dict, list)): - iterate_json(item) - else: - type_result = check_type(item) - if type_result == 'Numeric': - numeric_count += 1 - else: - text_count += 1 - - iterate_json(data) - with open(report_file, 'a') as file: - file.write(f'Ratio for Text Object to Numeric Object is : {text_count} : {numeric_count}\n\n') - - -def count_null_blank(csv_file): - df = pd.read_csv(csv_file) - column_stats = [] - - for column in df.columns: - null_count = df[column].isnull().sum() - blank_count = df[column].map(lambda x: str(x).strip() == '').sum() - data_type = df[column].dtype - q1=median=q3=iqr=bias=skewness=skew=0 - if data_type=='int64'or data_type=='float64': - values = df[column].dropna() - sorted_values = np.sort(values) - no_of_values = len(sorted_values) - q1_index = int(0.25 * (no_of_values + 1)) - q3_index = int(0.75 * (no_of_values + 1)) - if(q1_index!=0 or q3_index!=0): - q1 = sorted_values[q1_index - 1] - q3 = sorted_values[q3_index - 1] - iqr = q3 - q1 - bias = (q3 - q1) / (q3 + q1) - median = np.median(values) #q2 - skewness = 3 * (median - np.mean(values)) / np.std(values) - if((q3-median)<(median-q1)): - skew="Negative Skew" - else: - skew="Positive Skew" - column_stats.append((column, null_count, blank_count, data_type,q1,median,q3,iqr,bias,skewness,skew)) - - - with open(report_file, 'a') as file: - file.write('\t\t\t\t\t\t\t------ COLUMN WISE ANALYSIS ------\n\n') - for column, null_count, blank_count, data_type,q1,median,q3,iqr,bias,skewness,skew in column_stats: - file.write(f'Column Name : {column}\n') - file.write(f'Number of Null Values : {null_count}\n') - file.write(f'Number of Blank Values : {blank_count}\n') - file.write(f'Data type of column : {data_type}\n') - file.write(f'Quartile 1 Value : {q1}\n') - file.write(f'Quartile 2 Value : {median}\n') - file.write(f'Quartile 3 Value : {q3}\n') - file.write(f'InterQuartile Range : {iqr}\n') - file.write(f'Bias : {bias}\n') - file.write(f'Skewness Value: {skewness}\n') - file.write(f'Skew Result : {skew}\n') - file.write('---\n\n') - - -file_path = 'BSE_Companies.csv' -report_file = 'Report.txt' -with open(report_file, 'w') as file: - file.write('') -classification = file_type(file_path) -with open(report_file, 'a') as file: - file.write('\n\n\nREMARKS : \n') - file.write('\t\tThe Quartile, Bias and Skewness are only calculated for Numeric Columns and No Null and No Blank Columns.\n') - file.write('\nNOTE : *This is an AutoGenerated Analysis Report the Values Maybe Differ by the method of calculation and file neatness \n') - file.write("\t\t\t\t\t\t\t\t\t@ DATA STOREHOUSE") -print("The Report is updated in 'Report.txt' file...") \ No newline at end of file From 0e412059e0f315c751115ca0983cf1dda54aa005 Mon Sep 17 00:00:00 2001 From: chasserb Date: Sun, 1 Oct 2023 19:37:10 -0400 Subject: [PATCH 3/7] Option to exit prompt --- Validation/validate.py | 86 ++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/Validation/validate.py b/Validation/validate.py index 3f69ddf..86ddf5b 100644 --- a/Validation/validate.py +++ b/Validation/validate.py @@ -153,53 +153,49 @@ def count_null_blank(csv_file): def main(): - current_directory = os.getcwd() # Get the current directory - file_list = os.listdir(current_directory) # List files in the current directory - - # Filter the list to include only CSV and JSON files - valid_extensions = ('.csv', '.json') - valid_files = [file for file in file_list if file.endswith(valid_extensions)] - - # List the valid files - if valid_files: - print("Available CSV and JSON files in the current directory:") - for i, file_name in enumerate(valid_files, start=1): - print(f"{i}. {file_name}") - - # Enter the number assigned to the file - selection = click.prompt("Enter the number of the file to analyze", type=int) - - if 1 <= selection <= len(valid_files): - selected_file = valid_files[selection - 1] - file_path = os.path.join(current_directory, selected_file) - - with open('Report.txt', 'w') as report_file: - report_file.write('') - analyze_file(file_path) - with open('Report.txt', 'a') as report_file: - report_file.write('\n\n\nREMARKS:\n') - report_file.write('\tThe Quartile, Bias, and Skewness are only calculated for Numeric Columns and No Null and No Blank Columns.\n') - report_file.write('\nNOTE: *This is an AutoGenerated Analysis Report, the Values May Differ by the method of calculation and file neatness\n') - report_file.write("\t@ DATA STOREHOUSE\n") - print("The Report is updated in 'Report.txt' file...") - - ''' - Automatically open the 'Report.txt' file with the default text editor. - Also, we need to check what the users operating system is so subprocess can open the correct shell. - - Darwin: macOS - - xdg-open: Linux and other - ''' - if platform.system() == 'Darwin': - subprocess.run(['open', 'Report.txt']) - elif platform.system() == 'Windows': - subprocess.run(['start', 'Report.txt'], shell=True) + while True: + current_directory = os.getcwd() + file_list = os.listdir(current_directory) + + valid_extensions = ('.csv', '.json') + valid_files = [file for file in file_list if file.endswith(valid_extensions)] + + if valid_files: + print("Available CSV and JSON files in the current directory:") + for i, file_name in enumerate(valid_files, start=1): + print(f"{i}. {file_name}") + + print("0. Exit") # Add an option to exit + + selection = click.prompt("Enter the number of the file to analyze or 0 to exit", type=int) + + if selection == 0: # Exit if the user enters 0 + print("Exiting prompt.") + break + elif 1 <= selection <= len(valid_files): + selected_file = valid_files[selection - 1] + file_path = os.path.join(current_directory, selected_file) + + with open('Report.txt', 'w') as report_file: + report_file.write('') + analyze_file(file_path) + with open('Report.txt', 'a') as report_file: + report_file.write('\n\n\nREMARKS:\n') + report_file.write('\tThe Quartile, Bias, and Skewness are only calculated for Numeric Columns and No Null and No Blank Columns.\n') + report_file.write('\nNOTE: *This is an AutoGenerated Analysis Report, the Values May Differ by the method of calculation and file neatness\n') + report_file.write("\t@ DATA STOREHOUSE\n") + print("The Report is updated in 'Report.txt' file...") + + if platform.system() == 'Darwin': + subprocess.run(['open', 'Report.txt']) + elif platform.system() == 'Windows': + subprocess.run(['start', 'Report.txt'], shell=True) + else: + subprocess.run(['xdg-open', 'Report.txt']) else: - subprocess.run(['xdg-open', 'Report.txt']) - + print("Invalid selection.") else: - print("Invalid selection.") - else: - print("No CSV or JSON files found in the current directory.") + print("No CSV or JSON files found in the current directory.") if __name__ == "__main__": main() From c4dc5ea5d9005b21a4fce4ee6e5db3e992d3efcb Mon Sep 17 00:00:00 2001 From: chasserb Date: Sun, 1 Oct 2023 20:24:05 -0400 Subject: [PATCH 4/7] ascii and formatting --- Validation/validate.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Validation/validate.py b/Validation/validate.py index 86ddf5b..847e79e 100644 --- a/Validation/validate.py +++ b/Validation/validate.py @@ -160,12 +160,22 @@ def main(): valid_extensions = ('.csv', '.json') valid_files = [file for file in file_list if file.endswith(valid_extensions)] + print ("""\n + ######## ### ######## ### ###### ######## ####### ######## ######## ## ## ####### ## ## ###### ######## + ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## + ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## + ## ## ## ## ## ## ## ###### ## ## ## ######## ###### ######### ## ## ## ## ###### ###### + ## ## ######### ## ######### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## + ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## + ######## ## ## ## ## ## ###### ## ####### ## ## ######## ## ## ####### ####### ###### ######## + """) + if valid_files: - print("Available CSV and JSON files in the current directory:") + print("Available CSV and JSON files in the current directory:\n") for i, file_name in enumerate(valid_files, start=1): print(f"{i}. {file_name}") - print("0. Exit") # Add an option to exit + print("0. Exit\n") # Add an option to exit selection = click.prompt("Enter the number of the file to analyze or 0 to exit", type=int) From a5067a47803ce3577cd7989f8147be35be21599d Mon Sep 17 00:00:00 2001 From: chasserb Date: Mon, 2 Oct 2023 09:08:09 -0400 Subject: [PATCH 5/7] Ability to enter your own filepath --- Validation/validate.py | 75 ++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/Validation/validate.py b/Validation/validate.py index 847e79e..b8ad63c 100644 --- a/Validation/validate.py +++ b/Validation/validate.py @@ -1,8 +1,3 @@ -""" --------------------------------- UNDER DEVELOPMENT ----------------------------------------- - -""" - import re import os import subprocess @@ -151,13 +146,12 @@ def count_null_blank(csv_file): open_report(f'Skew Result : {skew}\n') open_report('---\n\n') - def main(): while True: current_directory = os.getcwd() file_list = os.listdir(current_directory) - valid_extensions = ('.csv', '.json') + valid_extensions = ('.csv', '.json', '.txt') valid_files = [file for file in file_list if file.endswith(valid_extensions)] print ("""\n @@ -171,41 +165,58 @@ def main(): """) if valid_files: - print("Available CSV and JSON files in the current directory:\n") + print("Available files in the current directory:\n") for i, file_name in enumerate(valid_files, start=1): print(f"{i}. {file_name}") - print("0. Exit\n") # Add an option to exit + print("\nOther prompts:") + print("\n0. Exit") + print("p. Enter your own file path\n") - selection = click.prompt("Enter the number of the file to analyze or 0 to exit", type=int) + selection = click.prompt("Enter the number of the file to analyze, p to enter a custom file path, or 0 to exit") - if selection == 0: # Exit if the user enters 0 + if selection == '0': # Exit if the user enters '0' print("Exiting prompt.") - break - elif 1 <= selection <= len(valid_files): - selected_file = valid_files[selection - 1] - file_path = os.path.join(current_directory, selected_file) - - with open('Report.txt', 'w') as report_file: - report_file.write('') - analyze_file(file_path) - with open('Report.txt', 'a') as report_file: - report_file.write('\n\n\nREMARKS:\n') - report_file.write('\tThe Quartile, Bias, and Skewness are only calculated for Numeric Columns and No Null and No Blank Columns.\n') - report_file.write('\nNOTE: *This is an AutoGenerated Analysis Report, the Values May Differ by the method of calculation and file neatness\n') - report_file.write("\t@ DATA STOREHOUSE\n") - print("The Report is updated in 'Report.txt' file...") - - if platform.system() == 'Darwin': - subprocess.run(['open', 'Report.txt']) - elif platform.system() == 'Windows': - subprocess.run(['start', 'Report.txt'], shell=True) + return + elif selection == 'p': # Allow the user to enter a custom file path with 'p' + custom_file_path = click.prompt("Enter the custom file path:") + if os.path.isfile(custom_file_path): + file_path = custom_file_path else: - subprocess.run(['xdg-open', 'Report.txt']) + print("Invalid file path. Please make sure the file exists.") + continue + elif '1' <= selection <= '9' and int(selection) <= len(valid_files): # Check for valid file selection + selected_file = valid_files[int(selection) - 1] + file_path = os.path.join(current_directory, selected_file) else: print("Invalid selection.") + continue + + with open('Report.txt', 'w') as report_file: + report_file.write('') + analyze_file(file_path) + with open('Report.txt', 'a') as report_file: + report_file.write('\n\n\nREMARKS:\n') + report_file.write('\tThe Quartile, Bias, and Skewness are only calculated for Numeric Columns and No Null and No Blank Columns.\n') + report_file.write('\nNOTE: *This is an AutoGenerated Analysis Report, the Values May Differ by the method of calculation and file neatness\n') + report_file.write("\t@ DATA STOREHOUSE\n") + print("The Report is updated in 'Report.txt' file...") + + ''' + Automatically open the 'Report.txt' file with the default text editor. + Also, we need to check what the users operating system is so subprocess can open the correct shell. + - Darwin: macOS + - xdg-open: Linux and other + ''' + + if platform.system() == 'Darwin': + subprocess.run(['open', 'Report.txt']) + elif platform.system() == 'Windows': + subprocess.run(['start', 'Report.txt'], shell=True) + else: + subprocess.run(['xdg-open', 'Report.txt']) else: - print("No CSV or JSON files found in the current directory.") + print("No CSV, JSON, or TXT files found in the current directory.") if __name__ == "__main__": main() From e9b12170baedcf9c0f73bd3bbc201c781222f137 Mon Sep 17 00:00:00 2001 From: chasserb Date: Mon, 2 Oct 2023 09:21:19 -0400 Subject: [PATCH 6/7] Need to ignore certain files --- Validation/validate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Validation/validate.py b/Validation/validate.py index b8ad63c..2a3627f 100644 --- a/Validation/validate.py +++ b/Validation/validate.py @@ -152,7 +152,8 @@ def main(): file_list = os.listdir(current_directory) valid_extensions = ('.csv', '.json', '.txt') - valid_files = [file for file in file_list if file.endswith(valid_extensions)] + ignore_files = ('Report.txt', 'requirements.txt') + valid_files = [file for file in file_list if file.endswith(valid_extensions)and file not in ignore_files] print ("""\n ######## ### ######## ### ###### ######## ####### ######## ######## ## ## ####### ## ## ###### ######## @@ -179,7 +180,7 @@ def main(): print("Exiting prompt.") return elif selection == 'p': # Allow the user to enter a custom file path with 'p' - custom_file_path = click.prompt("Enter the custom file path:") + custom_file_path = click.prompt("Enter the custom file path") if os.path.isfile(custom_file_path): file_path = custom_file_path else: From 64afe1252a05cbc312887f433cd071edb77baf26 Mon Sep 17 00:00:00 2001 From: chasserb Date: Tue, 10 Oct 2023 20:13:31 -0400 Subject: [PATCH 7/7] Added art package for ASCII --- Validation/requirements.txt | 3 ++- Validation/validate.py | 11 ++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Validation/requirements.txt b/Validation/requirements.txt index 5b2f314..9da857c 100644 --- a/Validation/requirements.txt +++ b/Validation/requirements.txt @@ -1,2 +1,3 @@ termcolor==2.3.0 -pandas==2.0.3 \ No newline at end of file +pandas==2.0.3 +art==6.1 diff --git a/Validation/validate.py b/Validation/validate.py index 2a3627f..a630014 100644 --- a/Validation/validate.py +++ b/Validation/validate.py @@ -6,6 +6,7 @@ import numpy as np import json import platform +from art import * REPORT_FILE = 'Report.txt' @@ -155,15 +156,7 @@ def main(): ignore_files = ('Report.txt', 'requirements.txt') valid_files = [file for file in file_list if file.endswith(valid_extensions)and file not in ignore_files] - print ("""\n - ######## ### ######## ### ###### ######## ####### ######## ######## ## ## ####### ## ## ###### ######## - ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## - ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## - ## ## ## ## ## ## ## ###### ## ## ## ######## ###### ######### ## ## ## ## ###### ###### - ## ## ######### ## ######### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## - ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## - ######## ## ## ## ## ## ###### ## ####### ## ## ######## ## ## ####### ####### ###### ######## - """) + tprint("DataStoreHouse") if valid_files: print("Available files in the current directory:\n")