mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 05:21:48 +00:00
Allow commands that don't need arguments to print help
This commit is contained in:
@@ -13,7 +13,9 @@ def sectors(l_args):
|
||||
S&P500 incumbents. Pops plot in terminal. [Source: Alpha Vantage]""",
|
||||
)
|
||||
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
sector_perf = SectorPerformances(
|
||||
key=cfg.API_KEY_ALPHAVANTAGE, output_format="pandas"
|
||||
|
||||
@@ -10,7 +10,9 @@ def spachero(l_args):
|
||||
description="""Great website for SPACs research. [Source: www.spachero.com]""",
|
||||
)
|
||||
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
pns_parser = arse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
webbrowser.open("https://www.spachero.com")
|
||||
print("")
|
||||
|
||||
@@ -10,7 +10,9 @@ def unusual_whales(l_args):
|
||||
description="""Good website for SPACs research. [Source: www.unusualwhales.com]""",
|
||||
)
|
||||
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
webbrowser.open("https://unusualwhales.com/spacs")
|
||||
print("")
|
||||
|
||||
@@ -123,7 +123,9 @@ def estimates(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
url_market_business_insider = (
|
||||
f"https://markets.businessinsider.com/stocks/{s_ticker.lower()}-stock"
|
||||
|
||||
@@ -16,7 +16,9 @@ def rating(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
df_fa = fa.rating(s_ticker, cfg.API_KEY_FINANCIALMODELINGPREP)
|
||||
print(df_fa)
|
||||
|
||||
@@ -34,7 +34,9 @@ def overview(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
# Request OVERVIEW data from Alpha Vantage API
|
||||
s_req = f"https://www.alphavantage.co/query?function=OVERVIEW&symbol={s_ticker}&apikey={cfg.API_KEY_ALPHAVANTAGE}"
|
||||
@@ -100,7 +102,9 @@ def key(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
# Request OVERVIEW data
|
||||
s_req = f"https://www.alphavantage.co/query?function=OVERVIEW&symbol={s_ticker}&apikey={cfg.API_KEY_ALPHAVANTAGE}"
|
||||
|
||||
@@ -17,7 +17,9 @@ def management(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
url_market_business_insider = (
|
||||
f"https://markets.businessinsider.com/stocks/{s_ticker.lower()}-stock"
|
||||
|
||||
@@ -26,7 +26,9 @@ def profile(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
df_fa = fa.profile(s_ticker, cfg.API_KEY_FINANCIALMODELINGPREP)
|
||||
clean_df_index(df_fa)
|
||||
@@ -57,7 +59,9 @@ def quote(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
df_fa = fa.quote(s_ticker, cfg.API_KEY_FINANCIALMODELINGPREP)
|
||||
|
||||
|
||||
@@ -24,7 +24,9 @@ def screener(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
d_finviz_stock = finviz.get_stock(s_ticker)
|
||||
df_fa = pd.DataFrame.from_dict(
|
||||
|
||||
@@ -36,7 +36,9 @@ def info(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
stock = yf.Ticker(s_ticker)
|
||||
df_info = pd.DataFrame(stock.info.items(), columns=["Metric", "Value"])
|
||||
@@ -93,7 +95,9 @@ def shareholders(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
stock = yf.Ticker(s_ticker)
|
||||
pd.set_option("display.max_colwidth", None)
|
||||
@@ -165,7 +169,9 @@ def sustainability(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
stock = yf.Ticker(s_ticker)
|
||||
pd.set_option("display.max_colwidth", None)
|
||||
@@ -214,7 +220,9 @@ def calendar_earnings(l_args, s_ticker):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
stock = yf.Ticker(s_ticker)
|
||||
df_calendar = stock.calendar
|
||||
|
||||
@@ -74,7 +74,10 @@ def clear(l_args, s_ticker, s_start, s_interval, df_stock):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return "", "", "", pd.DataFrame()
|
||||
|
||||
print("Clearing stock ticker to be used for analysis\n")
|
||||
return "", "", "", pd.DataFrame()
|
||||
|
||||
|
||||
@@ -113,7 +113,9 @@ def trending(l_args):
|
||||
)
|
||||
|
||||
try:
|
||||
parse_known_args_and_warn(parser, l_args)
|
||||
ns_parser = parse_known_args_and_warn(parser, l_args)
|
||||
if not ns_parser:
|
||||
return
|
||||
|
||||
result = requests.get("https://api.stocktwits.com/api/2/trending/symbols.json")
|
||||
if result.status_code == 200:
|
||||
|
||||
Reference in New Issue
Block a user