-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.py
27 lines (21 loc) · 888 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import logging
from pack.util import save_spx_components_stock_to_file, save_nasdaq_components_stock_to_file, \
fetch_fx_components_stock_price, load_config, fetch_nasdaq_components_stock_price, fetch_etf_components_stock_price, \
fetch_spx_components_stock_price
def main():
config = load_config()
logging_main_path = config['LOGGING']['MAIN_PATH']
logging.basicConfig(
level=config['LOGGING']['LEVEL'],
format='%(asctime)s %(levelname)s %(message)s',
datefmt='%Y-%m-%d %H:%M',
handlers=[logging.FileHandler(logging_main_path, 'w', 'utf-8'), ]
)
save_nasdaq_components_stock_to_file()
save_spx_components_stock_to_file()
fetch_etf_components_stock_price()
fetch_fx_components_stock_price()
fetch_nasdaq_components_stock_price()
fetch_spx_components_stock_price()
if __name__ == "__main__":
main()