You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 lines
439 B

import sqlite3
import pandas as pd
import os
DB_PATH = "stock_data.db"
def init_db():
conn = sqlite3.connect(DB_PATH)
cursor = conn.cursor()
cursor.execute("""
CREATE TABLE IF NOT EXISTS stock_daily (
code TEXT,
date TEXT,
open REAL,
close REAL,
high REAL,
low REAL,
volume REAL,
PRIMARY KEY (code, date)
)
""")
conn.commit()
conn.close()