init
This commit is contained in:
@@ -1,23 +1,26 @@
|
||||
import os
|
||||
import shutil
|
||||
import datetime
|
||||
import time
|
||||
from datetime import datetime
|
||||
|
||||
from stock.crawler.FnGuideCrawler import FnGuideCrawler
|
||||
from stock.crawler.MetaCrawler import MetaCrawler
|
||||
from stock.crawler.StockCrawler import StockCrawler
|
||||
from stock.analysis.AnalyzerSqlite import AnalyzerSqlite
|
||||
|
||||
today = datetime.datetime.now().strftime("%Y-%m-%d")
|
||||
today = datetime.now().strftime("%Y-%m-%d")
|
||||
|
||||
# DB Browser for SQLite: http://hleecaster.com/python-sqlite3/
|
||||
|
||||
PROJECT_HOME = os.path.join(os.path.dirname(os.path.join(os.path.dirname(os.path.join(os.path.dirname(os.path.join(os.path.dirname(__file__))))))))
|
||||
PROJECT_HOME = os.path.join(os.path.dirname(__file__))
|
||||
|
||||
START_DATE = "1900.01.01"
|
||||
start = time.time()
|
||||
stockFileName = PROJECT_HOME + '/resources/stock.db'
|
||||
|
||||
week = datetime.today().weekday()
|
||||
|
||||
if week in (0, 1, 2, 3, 4):
|
||||
# 재무제표는 3개월마다 다운로드를 한다.
|
||||
fnGuideCrawler = FnGuideCrawler(START_DATE)
|
||||
print("[KOSPI 상장기업 재무제표 다운로드]")
|
||||
@@ -58,7 +61,7 @@ analyzerSqlite.analyzeGrouping("monthly")
|
||||
|
||||
analyzerSqlite = AnalyzerSqlite(PROJECT_HOME, stockFileName)
|
||||
print("\n[종목 결정]")
|
||||
day = datetime.datetime.today().strftime("%Y%m%d")
|
||||
day = datetime.today().strftime("%Y%m%d")
|
||||
outPath = PROJECT_HOME + "/resources/analysis/" + day
|
||||
if os.path.isdir(outPath):
|
||||
shutil.rmtree(outPath)
|
||||
@@ -67,8 +70,6 @@ print("print to Html...")
|
||||
analyzerSqlite.findCandidate(outPath)
|
||||
# E: 분석까지 진행
|
||||
|
||||
|
||||
|
||||
print("time : %6.2f 초", (time.time() - start))
|
||||
|
||||
print ("done...")
|
||||
|
||||
Reference in New Issue
Block a user