Nolan Zandi
fix missing init file
fb65c41
raw
history blame
642 Bytes
import pandas as pd
import sqlite3
def process_data_upload(data_file, session_hash):
df = pd.read_csv(data_file, sep=";")
# Read each sheet and store data in a DataFrame
#data = df.parse(sheet_name)
# Process the data as needed
# ...
df.columns = df.columns.str.replace(' ', '_')
df.columns = df.columns.str.replace('/', '_')
connection = sqlite3.connect(f'data_source_{session_hash}.db')
print("Opened database successfully");
print(df.columns)
df.to_sql('data_source', connection, if_exists='replace', index = False)
connection.commit()
connection.close()