#USER INPUT from preprocessing import run_preprocessing from ai_transcriber import transcribe_all from reconciliate_and_upload import reconciliate_and_upload import os import time def run_main( source_folder_with_reciepts, link_to_csv, folder_to_save_processed_reciepts, folder_to_save_reconciled_data , name_output_file = "[AI generated] June 2024.xlsx", transaction_csv_path = 'downloaded_file.csv', data_path = "trial2" ): os.system("apt update; yes | apt-get install poppler-utils; yes | ls") data_path = time.time().__str__().replace(".","") # breakpoint() source_folder_with_reciepts = source_folder_with_reciepts.split("?")[0].split("/")[-1] folder_to_save_processed_reciepts = folder_to_save_processed_reciepts.split("?")[0].split("/")[-1] folder_to_save_reconciled_data = folder_to_save_reconciled_data.split("?")[0].split("/")[-1] link_to_csv = link_to_csv.split("/view?")[0].split("/")[-1] print("Extracted link csv id: ", link_to_csv) name_output_file = name_output_file + ".xlsx" name_output_file = name_output_file.replace(".xlsx.xlsx", ".xlsx") # breakpoint() run_preprocessing(data_path, source_folder_with_reciepts, link_to_csv) print("Done pre-processing!") transcribe_all(data_path) print("Done transcription!") id_output = reconciliate_and_upload( data_path, name_of_csv=transaction_csv_path, folder_to_save_processed_reciepts=folder_to_save_processed_reciepts, folder_to_save_reconciled_data = folder_to_save_reconciled_data, name_of_output=name_output_file) url_output_file = "https://drive.google.com/file/d/" + str(id_output) display = f"[Voir tableau final]({url_output_file})" print("Done all!") return display