mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
Improve try-catch to not print help on except
This commit is contained in:
@@ -29,7 +29,8 @@ def overview(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
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}"
|
||||
@@ -70,9 +71,10 @@ def overview(l_args, s_ticker):
|
||||
print("")
|
||||
else:
|
||||
print(f"Error: {result.status_code}")
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -89,7 +91,8 @@ def key(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
# Request OVERVIEW data
|
||||
s_req = f"https://www.alphavantage.co/query?function=OVERVIEW&symbol={s_ticker}&apikey={cfg.API_KEY_ALPHAVANTAGE}"
|
||||
@@ -117,8 +120,10 @@ def key(l_args, s_ticker):
|
||||
else:
|
||||
print(f"Error: {result.status_code}")
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -141,7 +146,8 @@ def income_statement(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -163,10 +169,11 @@ def income_statement(l_args, s_ticker):
|
||||
df_fa.index = [s_val.capitalize() for s_val in df_fa.index]
|
||||
df_fa.columns.name = "Fiscal Date Ending"
|
||||
print(df_fa)
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -195,7 +202,8 @@ def balance_sheet(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -217,10 +225,11 @@ def balance_sheet(l_args, s_ticker):
|
||||
df_fa.index = [s_val.capitalize() for s_val in df_fa.index]
|
||||
df_fa.columns.name = "Fiscal Date Ending"
|
||||
print(df_fa)
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -246,7 +255,8 @@ def cash_flow(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -268,10 +278,11 @@ def cash_flow(l_args, s_ticker):
|
||||
df_fa.index = [s_val.capitalize() for s_val in df_fa.index]
|
||||
df_fa.columns.name = "Fiscal Date Ending"
|
||||
print(df_fa)
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -289,7 +300,8 @@ def earnings(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -321,7 +333,9 @@ def earnings(l_args, s_ticker):
|
||||
print("")
|
||||
else:
|
||||
print(f"Error: {result.status_code}")
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
@@ -21,7 +21,8 @@ def profile(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
df_fa = fa.profile(s_ticker, cfg.API_KEY_FINANCIALMODELINGPREP)
|
||||
df_fa.index = [''.join(' ' + char if char.isupper() else char.strip() for char in idx).strip() for idx in df_fa.index.tolist()]
|
||||
@@ -29,10 +30,11 @@ def profile(l_args, s_ticker):
|
||||
print(df_fa.drop(index=['Description', 'Image']).to_string(header=False))
|
||||
print(f"\nImage: {df_fa.loc['Image'][0]}")
|
||||
print(f"\nDescription: {df_fa.loc['Description'][0]}")
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -47,14 +49,16 @@ def rating(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
df_fa = fa.rating(s_ticker, cfg.API_KEY_FINANCIALMODELINGPREP)
|
||||
print(df_fa)
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -72,7 +76,8 @@ def quote(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
df_fa = fa.quote(s_ticker, cfg.API_KEY_FINANCIALMODELINGPREP)
|
||||
df_fa.index = [''.join(' ' + char if char.isupper() else char.strip() for char in idx).strip() for idx in df_fa.index.tolist()]
|
||||
@@ -83,10 +88,11 @@ def quote(l_args, s_ticker):
|
||||
earning_announcment = datetime.strptime(df_fa.loc['Earnings announcement'][0][0:19],"%Y-%m-%dT%H:%M:%S")
|
||||
df_fa.loc['Earnings announcement'][0] = f"{earning_announcment.date()} {earning_announcment.time()}"
|
||||
print(df_fa.to_string(header=False))
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -105,7 +111,8 @@ def enterprise(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -122,10 +129,11 @@ def enterprise(l_args, s_ticker):
|
||||
df_fa.index = [''.join(' ' + char if char.isupper() else char.strip() for char in idx).strip() for idx in df_fa.index.tolist()]
|
||||
df_fa.index = [s_val.capitalize() for s_val in df_fa.index]
|
||||
print(df_fa)
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -142,7 +150,8 @@ def discounted_cash_flow(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -160,10 +169,11 @@ def discounted_cash_flow(l_args, s_ticker):
|
||||
df_fa.index = [s_val.capitalize() for s_val in df_fa.index]
|
||||
df_fa = df_fa.rename(index={"D c f": "DCF"})
|
||||
print(df_fa)
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -187,7 +197,8 @@ def income_statement(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -213,10 +224,11 @@ def income_statement(l_args, s_ticker):
|
||||
print(df_fa.loc['Final link'].to_frame().to_string())
|
||||
print("")
|
||||
print(df_fa.loc['Link'].to_frame().to_string())
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -245,7 +257,8 @@ def balance_sheet(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -271,10 +284,11 @@ def balance_sheet(l_args, s_ticker):
|
||||
print(df_fa.loc['Final link'].to_frame().to_string())
|
||||
print("")
|
||||
print(df_fa.loc['Link'].to_frame().to_string())
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -300,7 +314,8 @@ def cash_flow(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -326,10 +341,11 @@ def cash_flow(l_args, s_ticker):
|
||||
print(df_fa.loc['Final link'].to_frame().to_string())
|
||||
print("")
|
||||
print(df_fa.loc['Link'].to_frame().to_string())
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -360,7 +376,8 @@ def key_metrics(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -382,10 +399,11 @@ def key_metrics(l_args, s_ticker):
|
||||
df_fa = df_fa.rename(index={"Enterprise value over e b i t d a": "Enterprise value over EBITDA"})
|
||||
df_fa = df_fa.rename(index={"Net debt to e b i t d a": "Net debt to EBITDA"})
|
||||
print(df_fa)
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -417,7 +435,8 @@ def financial_ratios(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -438,10 +457,11 @@ def financial_ratios(l_args, s_ticker):
|
||||
df_fa.columns.name = "Fiscal Date Ending"
|
||||
df_fa = df_fa.rename(index={"Net income per e b t": "Net income per EBT"})
|
||||
print(df_fa)
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -470,7 +490,8 @@ def financial_statement_growth(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.n_num == 1:
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
@@ -489,11 +510,11 @@ def financial_statement_growth(l_args, s_ticker):
|
||||
df_fa.index = [''.join(' ' + char if char.isupper() else char.strip() for char in idx).strip() for idx in df_fa.index.tolist()]
|
||||
df_fa.index = [s_val.capitalize() for s_val in df_fa.index]
|
||||
df_fa.columns.name = "Fiscal Date Ending"
|
||||
|
||||
print(df_fa)
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
@@ -21,16 +21,18 @@ def screener(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
d_finviz_stock = finviz.get_stock(s_ticker)
|
||||
df_fa = pd.DataFrame.from_dict(d_finviz_stock, orient='index', columns=['Values'])
|
||||
df_fa = df_fa[df_fa.Values != '-']
|
||||
print(df_fa.to_string(header=False))
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -47,17 +49,19 @@ def insider(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
d_finviz_insider = finviz.get_insider(s_ticker)
|
||||
df_fa = pd.DataFrame.from_dict(d_finviz_insider)
|
||||
df_fa.set_index("Date", inplace=True)
|
||||
df_fa = df_fa[['Relationship', 'Transaction', '#Shares', 'Cost', 'Value ($)', '#Shares Total', 'Insider Trading', 'SEC Form 4']]
|
||||
print(df_fa.head(n=ns_parser.n_num))
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -73,7 +77,8 @@ def news(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
d_finviz_news = finviz.get_news(s_ticker)
|
||||
i=0
|
||||
@@ -85,8 +90,10 @@ def news(l_args, s_ticker):
|
||||
if i > (ns_parser.n_num-1):
|
||||
break
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -101,14 +108,16 @@ def analyst(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
d_finviz_analyst_price = finviz.get_analyst_price_targets(s_ticker)
|
||||
df_fa = pd.DataFrame.from_dict(d_finviz_analyst_price)
|
||||
df_fa.set_index("date", inplace=True)
|
||||
print(df_fa)
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
@@ -30,7 +30,8 @@ def income(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.b_quarter:
|
||||
url_financials = f"https://www.marketwatch.com/investing/stock/{s_ticker}/financials/income/quarter"
|
||||
@@ -59,7 +60,7 @@ def income(l_args, s_ticker):
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -145,7 +146,8 @@ def liabilities(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.b_quarter:
|
||||
url_financials = f"https://www.marketwatch.com/investing/stock/{s_ticker}/financials/balance-sheet/quarter"
|
||||
@@ -178,7 +180,7 @@ def liabilities(l_args, s_ticker):
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -198,7 +200,9 @@ def operating(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
|
||||
if ns_parser.b_quarter:
|
||||
url_financials = f"https://www.marketwatch.com/investing/stock/{s_ticker}/financials/cash-flow/quarter"
|
||||
@@ -235,7 +239,7 @@ def operating(l_args, s_ticker):
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -255,7 +259,8 @@ def investing(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.b_quarter:
|
||||
url_financials = f"https://www.marketwatch.com/investing/stock/{s_ticker}/financials/cash-flow/quarter"
|
||||
@@ -292,7 +297,7 @@ def investing(l_args, s_ticker):
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -315,7 +320,8 @@ def financing(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
if ns_parser.b_quarter:
|
||||
url_financials = f"https://www.marketwatch.com/investing/stock/{s_ticker}/financials/cash-flow/quarter"
|
||||
@@ -352,7 +358,7 @@ def financing(l_args, s_ticker):
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -369,7 +375,8 @@ def sec_fillings(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
pd.set_option('display.max_colwidth', -1)
|
||||
|
||||
@@ -405,9 +412,9 @@ def sec_fillings(l_args, s_ticker):
|
||||
|
||||
print(df_financials.head(n=ns_parser.n_num))
|
||||
print("")
|
||||
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
|
||||
@@ -424,7 +431,8 @@ def sean_seah_warnings(l_args, s_ticker):
|
||||
(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}")
|
||||
print(f"The following args couldn't be interpreted: {l_unknown_args}\n")
|
||||
return
|
||||
|
||||
# From INCOME STATEMENT, get: 'EPS (Basic)', 'Net Income', 'Interest Expense', 'EBITDA'
|
||||
url_financials = f"https://www.marketwatch.com/investing/stock/{s_ticker}/financials/income"
|
||||
@@ -543,6 +551,7 @@ def sean_seah_warnings(l_args, s_ticker):
|
||||
print("None. Good stonk")
|
||||
|
||||
print("")
|
||||
|
||||
except:
|
||||
print("ERROR!\n")
|
||||
print("")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user