@@ -7,6 +7,7 @@ import os
77import time
88
99import modules .config_details as conf_info
10+ import modules .tickers_helpers as helpers
1011
1112# TODO REMOVE THE FOLLOWING TICKERS, LOAD THEM FROM THE CSV FILES INSTEAD
1213tickers_clothes = [ 'NKE' , 'UA' , 'ADDYY' , 'ADS' , 'LULU' ]
@@ -26,31 +27,6 @@ def merge_lists():
2627
2728##########################################################################
2829##########################################################################
29- # import os
30- import glob
31-
32- def process_tickers_lists_csv_files ():
33- all_tickers_all_files = []
34- for file in glob .glob ('./data/conf/tickers_*.csv' ):
35- print 'Found this:' , file
36- tickers_to_process = get_tickers_from_csv_file (file )
37- print ' >>> Found tickers:' , tickers_to_process
38- all_tickers_all_files .extend (tickers_to_process )
39- print 'ALL OF ALL:' , all_tickers_all_files
40-
41- import csv
42- def get_tickers_from_csv_file (filename ):
43- all_tickers_for_file = []
44- with open (filename , 'rb' ) as csvfile :
45- dialect = csv .Sniffer ().sniff (csvfile .read (), delimiters = ':' )
46- csvfile .seek (0 )
47- reader = csv .reader (csvfile , dialect )
48- for row in reader :
49- print ' Current row:' , '_SEPARATOR_' .join (row )
50- current_tickers = row [1 ].split (',' )
51- print ' Tickers:' , current_tickers
52- all_tickers_for_file .extend (current_tickers )
53- return all_tickers_for_file
5430
5531##########################################################################
5632##########################################################################
@@ -98,5 +74,5 @@ def get_after_2016_02(tickers, store_dir):
9874# get_before_2016_02(merge_lists(),conf_info.stock_prices_dir)
9975# get_after_2016_02(merge_lists(),conf_info.stock_prices_dir)
10076
101- process_tickers_lists_csv_files ()
77+ print helpers . get_all_tickers_lists_csv_files ()
10278
0 commit comments