-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
70 lines (64 loc) · 1.99 KB
/
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
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
import sys
from tasks.fetch_and_store_v2 import fetch_and_store_v2
from tasks.fetch_ipo_details import fetch_ipo_details
from tasks.notify import notify
from tasks.get_market_sentiment import get_market_sentiment
from tasks.get_rh_prospectus import get_rh_prospectus
from tasks.fetch_and_store import fetch_and_store
from tasks.update_redis_hash import update_redis_hash
available_commands = {
'notify': {
'name': 'notify',
'help': '',
},
'fetch_ipo_details': {
'name': 'fetch_ipo_details',
'help': '',
},
'get_market_sentiment': {
'name': 'get_market_sentiment',
'help': '',
},
'get_rh_prospectus': {
'name': 'get_market_prospectus',
'help': '',
},
'fetch_and_store': {
'name': 'fetch_and_store',
'help':'',
},
'update_redis_hash': {
'name': 'update_redis_hash',
'help': '',
},
'fetch_v2':{
'name' : 'fetch_v2',
'help': ''
}
}
def main(argv):
if not len(argv) or argv[0] not in available_commands.keys():
print('Available commands: ')
for key, val in available_commands.items():
print('-> {}: {}'.format(
key, val['help']
))
print('\n')
return
task_name = argv[0]
if task_name == available_commands['notify']['name']:
notify()
elif task_name == available_commands['get_rh_prospectus']['name']:
get_rh_prospectus()
elif task_name == available_commands['get_market_sentiment']['name']:
get_market_sentiment()
elif task_name == available_commands['fetch_ipo_details']['name']:
fetch_ipo_details()
elif task_name == available_commands['fetch_and_store']['name']:
fetch_and_store()
elif task_name == available_commands['update_redis_hash']['name']:
update_redis_hash()
elif task_name == available_commands['fetch_v2']['name']:
fetch_and_store_v2()
if __name__ == '__main__':
main(sys.argv[1:])