diff --git a/app.py b/app.py index 05a9a8f0..bb2a1b7c 100644 --- a/app.py +++ b/app.py @@ -10,8 +10,10 @@ @app.route('/snapshot') def snapshot(): with open('datasets/symbols.csv') as f: - symbols = f.read().splitlines() - for symbol in symbols: + for line in f: + if "," not in line: + continue + symbol = line.split(",")[0] data = yf.download(symbol, start="2020-01-01", end="2020-08-01") data.to_csv('datasets/daily/{}.csv'.format(symbol)) @@ -47,4 +49,4 @@ def index(): except Exception as e: print('failed on filename: ', filename) - return render_template('index.html', candlestick_patterns=candlestick_patterns, stocks=stocks, pattern=pattern) \ No newline at end of file + return render_template('index.html', candlestick_patterns=candlestick_patterns, stocks=stocks, pattern=pattern)