some new features

This commit is contained in:
ilgazca
2025-07-30 18:53:50 +03:00
parent 8019bd3b7c
commit 079804a0fc
2118 changed files with 297840 additions and 502 deletions

15
utils/file_handling.py Normal file
View File

@ -0,0 +1,15 @@
import pandas as pd
import os
def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1].lower() in {'csv', 'xls', 'xlsx'}
def read_file(filepath):
if filepath.endswith('.csv'):
return pd.read_csv(filepath)
else:
return pd.read_excel(filepath)
def save_processed_file(processed_df, filepath):
processed_df.to_csv(os.path.join(os.path.dirname(filepath), 'processed_' + os.path.basename(filepath)))
return 'processed_' + os.path.basename(filepath)