forked from OpenBB-finance/OpenBB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimply_wallst_api.py
29 lines (23 loc) · 1.59 KB
/
simply_wallst_api.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
import argparse
import webbrowser
# ---------------------------------------------------- Simply WallSt ----------------------------------------------------
def simply_wallst(l_args):
parser = argparse.ArgumentParser(prog='simply_wallst',
description='''Simply Wall Street Research. Opens web browser. Although this does not require
an API key, it requires a subscription to the website by the user (there's a 14 days free trial).
[Source: Simply Wall St.]''')
parser.add_argument('-i', "--industry", action="store", dest="s_industry", type=str, default="any", help="Industry of interest.",
choices=['any', 'automobiles', 'banks', 'capital-goods', 'commercial-services', 'consumer-durables',
'consumer-services', 'diversified-financials', 'energy', 'consumer-retailing',
'food-beverage-tobacco', 'healthcare', 'household', 'insurance', 'materials',
'media', 'pharmaceuticals-biotech', 'real-estate', 'retail', 'semiconductors',
'software', 'tech', 'telecom', 'transportation', 'utilities'] )
try:
(ns_parser, l_unknown_args) = parser.parse_known_args(l_args)
if l_unknown_args:
print(f"The following args couldn't be interpreted: {l_unknown_args}")
webbrowser.open(f"https://simplywall.st/stocks/us/{ns_parser.s_industry}?page=1")
print("")
except SystemExit:
print("")
return