diff --git a/quantcommon.py b/quantcommon.py index 4398ad4..a2cea81 100644 --- a/quantcommon.py +++ b/quantcommon.py @@ -53,4 +53,18 @@ class QuantCommon: finally: engine.dispose() - return value_list \ No newline at end of file + return value_list + + def get_price_list(self): + engine = self.create_engine() + + try: + price_list = pd.read_sql(""" + select 날짜, 종가, 종목코드 + from kor_price + where 날짜 >= (select (select max(날짜) from kor_price) - interval 1 year); + """, con=engine) + finally: + engine.dispose() + + return price_list \ No newline at end of file