init
This commit is contained in:
@@ -14,14 +14,13 @@ today = datetime.now().strftime("%Y-%m-%d")
|
||||
|
||||
PROJECT_HOME = os.getcwd()
|
||||
|
||||
START_DATE = "1900.01.01"
|
||||
START_DATE = "2000.01.01"
|
||||
start = time.time()
|
||||
stockFileName = PROJECT_HOME + '/resources/stock.db'
|
||||
|
||||
week = datetime.today().weekday()
|
||||
|
||||
if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
|
||||
if week in (0, 1, 2, 3, 4, 5, 6): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
# 재무제표는 3개월마다 다운로드를 한다.
|
||||
fnGuideCrawler = FnGuideCrawler(START_DATE)
|
||||
print("[KOSPI 상장기업 재무제표 다운로드]")
|
||||
@@ -52,8 +51,6 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
stockCrawler.crawl_stocks(stockFileName)
|
||||
stockCrawler.crawl_special_stocks(stockFileName)
|
||||
|
||||
|
||||
|
||||
print("\n[종목 분석]")
|
||||
# S: 분석까지 진행
|
||||
inFileName = PROJECT_HOME + '/resources/stock.db'
|
||||
@@ -77,5 +74,6 @@ if week in (0, 1, 2, 3, 4): # 0:월, 1:화, 2:수, 3:목, 4:금, 5:토, 6:일
|
||||
print("print to Html...")
|
||||
analyzerSqlite.findCandidate(outPath)
|
||||
|
||||
|
||||
print("time : %6.2f 초", (time.time() - start))
|
||||
print ("done...")
|
||||
|
||||
@@ -291,17 +291,16 @@ class StockCrawler:
|
||||
us_sotck_data = {}
|
||||
for ticker in special_stocks:
|
||||
|
||||
cursor.execute('SELECT * FROM ' + tableName + ' WHERE CODE=?', (ticker,))
|
||||
cursor.execute('SELECT ymd FROM ' + tableName + ' WHERE CODE=? order by ymd desc', (ticker,))
|
||||
|
||||
result = cursor.fetchone()
|
||||
if result == None:
|
||||
#start_day = pd.to_datetime('2017-01-01')
|
||||
start_day = pd.to_datetime(self.START_DATE.replace(".", "-"))
|
||||
end_day = pd.to_datetime(datetime.today().strftime('%Y-%m-%d'))
|
||||
if result is not None:
|
||||
start_day = result[0].replace(".", "-")
|
||||
end_day = datetime.today().strftime('%Y-%m-%d')
|
||||
else:
|
||||
#start = (datetime.today() - timedelta(days=300)).strftime('%Y-%m-%d')
|
||||
start_day = pd.to_datetime(self.START_DATE.replace(".", "-"))
|
||||
end_day = pd.to_datetime(datetime.today().strftime('%Y-%m-%d'))
|
||||
#start_day = pd.to_datetime('2017-01-01')
|
||||
start_day = self.START_DATE.replace(".", "-")
|
||||
end_day = datetime.today().strftime('%Y-%m-%d')
|
||||
|
||||
data = None
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user