-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.py
95 lines (78 loc) · 2.49 KB
/
options.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
from enum import Enum, auto
import os
class RunOptions(Enum):
RUN_FB = auto()
RUN_TICKER = auto()
RUN_INVESTPY = auto()
class SearchTypes(Enum):
GET_CRYPTO_LIST = auto()
GET_CRYPTO_OVERVIEW = auto()
GET_CRYPTO_INFO = auto()
GET_CRYPTO_HISTORICAL = auto()
GET_ETF_LIST = auto()
GET_ETF_COUNTRIES = auto()
GET_ETF_INFO = auto()
GET_ETF_HISTORICAL = auto()
GET_COMMO_INFO = auto()
GET_COMMO_LIST = auto()
GET_COMMO_BY_GROUP = auto()
GET_COMMO_OVERVIEW_BY_GROUP = auto()
GET_COMMO_HISTORICAL = auto()
class OptionContainer:
# tickers
PARSE_TICKER = True
# FB
RUN_FB = True
HEAD_LESS = True
BROWSER_STATUS = True
# investpy
RUN_INVESTPY = True
SAVE_DIR = r"finance_data_getter\files"
# Options
@classmethod
def save_path(cls, folder_name: str = SAVE_DIR) -> str:
curr = os.getcwd()
root = os.path.dirname(curr)
stored_file_loc = os.path.join(root, folder_name)
return stored_file_loc
@classmethod
def set_data_reader(cls, run: bool = PARSE_TICKER) -> bool:
if run is False:
OptionContainer.PARSE_TICKER = run
return OptionContainer.PARSE_TICKER
else:
return OptionContainer.PARSE_TICKER
@classmethod
def set_running_fb(cls, run: bool = RUN_FB):
if run is False:
OptionContainer.RUN_FB = run
print("Status : Not implemented")
return OptionContainer.RUN_FB
else:
print("Status : Running Facebook")
return OptionContainer.RUN_FB
@classmethod
def set_headless(cls, headless: bool = HEAD_LESS):
if headless is False:
print("Headless : No")
OptionContainer.HEAD_LESS = headless
return OptionContainer.HEAD_LESS
else:
print("Headless : Yes")
return OptionContainer.HEAD_LESS
@classmethod
def set_kill_browser(cls, kill: bool = BROWSER_STATUS):
if kill is False:
print("KillBrower : No")
OptionContainer.BROWSER_STATUS = kill
return OptionContainer.BROWSER_STATUS
else:
print("KillBrower : Yes")
return OptionContainer.BROWSER_STATUS
@classmethod
def set_investpy(cls, run: bool = RUN_INVESTPY) -> bool:
if run is False:
OptionContainer.RUN_INVESTPY = run
return OptionContainer.RUN_INVESTPY
else:
return OptionContainer.RUN_INVESTPY