PUSH EXCEL FILE TO SQLITE FILE
import pandas as pd
import sqlite3
EXCEL_FILE_NAME = 'source.xlsx'
DB_NAME = 'stage.db'
df= pd.read_excel(open(EXCEL_FILE_NAME , 'rb'),skiprows=3,index=False)
conn = sqlite3.connect(DB_NAME)
df.to_sql('source', conn)
READ FROM SQLITE
import pandas as pd
import sqlite3
DB_NAME = 'stage.db'
conn = sqlite3.connect(DB_NAME)
sql_string = 'select * from source_tbl where id>10'
df = pd.read_sql(sql_string, conn)
print(df)
Top comments (0)