Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/4526 #4682

Merged
merged 30 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e932dbb
Added fixes
colin99d Apr 3, 2023
8f268bf
Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBBTer…
colin99d Apr 4, 2023
2aebb6e
Merged
colin99d Apr 4, 2023
c094dbf
Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBBTer…
colin99d Apr 4, 2023
9475c59
Merged
colin99d Apr 4, 2023
2ec6ce5
Added some handling of errors
colin99d Apr 4, 2023
85ffb80
Merge branch 'develop' into hotfix/4526
colin99d Apr 4, 2023
bdfd4d2
Adds some read dbs
colin99d Apr 4, 2023
b1f36ce
Merge branch 'develop' into hotfix/4526
colin99d Apr 5, 2023
65e6753
Merge branch 'develop' into hotfix/4526
colin99d Apr 6, 2023
3e3aa5d
Removed useless commands
colin99d Apr 6, 2023
93d019e
Added fixes
colin99d Apr 6, 2023
b7ffdf1
Added fixes
colin99d Apr 6, 2023
02d915c
Merge branch 'develop' into hotfix/4526
colin99d Apr 6, 2023
3ae3fae
Added fix
colin99d Apr 6, 2023
c1ef9c1
Merge branch 'hotfix/4526' of https://github.com/OpenBB-finance/OpenB…
colin99d Apr 6, 2023
27670e8
Added fix
colin99d Apr 6, 2023
02075c5
Added fix
colin99d Apr 6, 2023
9fe593a
Added fix
colin99d Apr 6, 2023
2189e9c
Added fix
colin99d Apr 6, 2023
2d42613
Added fix
colin99d Apr 6, 2023
b7f4974
Merge branch 'develop' into hotfix/4526
colin99d Apr 10, 2023
f0d18f8
Merge branch 'develop' into hotfix/4526
colin99d Apr 10, 2023
f723cb7
Fixed tests
colin99d Apr 10, 2023
30b293c
Merge branch 'develop' into hotfix/4526
colin99d Apr 11, 2023
0755eab
Handle lowercase
colin99d Apr 11, 2023
95c8494
Added fxes
colin99d Apr 11, 2023
743c0c4
Merge branch 'develop' into hotfix/4526
colin99d Apr 11, 2023
d93c159
Merge branch 'develop' into hotfix/4526
colin99d Apr 11, 2023
892cce9
small ticker thing
jmaslek Apr 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions openbb_terminal/core/sdk/models/stocks_sdk_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ def __init__(self):
self.arkord = lib.stocks_disc_ark_model.get_ark_orders
self.asc = lib.stocks_disc_yahoofinance_model.get_asc
self.dividends = lib.stocks_disc_nasdaq_model.get_dividend_cal
self.filings = lib.stocks_fa_fmp_model.get_filings
self.filings_chart = lib.stocks_disc_fmp_view.display_filings
self.fipo = lib.stocks_disc_finnhub_model.get_future_ipo
self.gainers = lib.stocks_disc_yahoofinance_model.get_gainers
self.gtech = lib.stocks_disc_yahoofinance_model.get_gtech
Expand Down Expand Up @@ -334,8 +332,6 @@ def __init__(self):
self.rot_chart = lib.stocks_fa_finnhub_view.rating_over_time
self.score = lib.stocks_fa_fmp_model.get_score
self.sec = lib.stocks_fa_marketwatch_model.get_sec_filings
self.sec_fmp = lib.stocks_fa_fmp_model.get_filings
self.sec_fmp_chart = lib.stocks_fa_fmp_view.display_filings
self.shrs = lib.stocks_fa_yahoo_finance_model.get_shareholders
self.similar_dfs = lib.stocks_fa_dcf_model.get_similar_dfs
self.splits = lib.stocks_fa_yahoo_finance_model.get_splits
Expand Down
1 change: 0 additions & 1 deletion openbb_terminal/core/sdk/sdk_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@
from openbb_terminal.stocks.discovery import (
ark_model as stocks_disc_ark_model,
finnhub_model as stocks_disc_finnhub_model,
fmp_view as stocks_disc_fmp_view,
nasdaq_model as stocks_disc_nasdaq_model,
seeking_alpha_model as stocks_disc_seeking_alpha_model,
shortinterest_model as stocks_disc_shortinterest_model,
Expand Down
2 changes: 0 additions & 2 deletions openbb_terminal/core/sdk/trail_map.csv
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ stocks.disc.active,stocks_disc_yahoofinance_model.get_active,
stocks.disc.arkord,stocks_disc_ark_model.get_ark_orders,
stocks.disc.asc,stocks_disc_yahoofinance_model.get_asc,
stocks.disc.dividends,stocks_disc_nasdaq_model.get_dividend_cal,
stocks.disc.filings,stocks_fa_fmp_model.get_filings,stocks_disc_fmp_view.display_filings
stocks.disc.fipo,stocks_disc_finnhub_model.get_future_ipo,
stocks.disc.gainers,stocks_disc_yahoofinance_model.get_gainers,
stocks.disc.gtech,stocks_disc_yahoofinance_model.get_gtech,
Expand Down Expand Up @@ -473,7 +472,6 @@ stocks.fa.revfc,stocks_fa_seeking_alpha_model.get_estimates_rev,
stocks.fa.rot,stocks_fa_finnhub_model.get_rating_over_time,stocks_fa_finnhub_view.rating_over_time
stocks.fa.score,stocks_fa_fmp_model.get_score,
stocks.fa.sec,stocks_fa_marketwatch_model.get_sec_filings,
stocks.fa.sec_fmp,stocks_fa_fmp_model.get_filings,stocks_fa_fmp_view.display_filings
stocks.fa.shrs,stocks_fa_yahoo_finance_model.get_shareholders,
stocks.fa.similar_dfs,stocks_fa_dcf_model.get_similar_dfs,
stocks.fa.splits,stocks_fa_yahoo_finance_model.get_splits,stocks_fa_yahoo_finance_view.display_splits
Expand Down
3 changes: 1 addition & 2 deletions openbb_terminal/miscellaneous/sources/openbb_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,7 @@
"AlphaVantage"
],
"sec": [
"MarketWatch",
"FinancialModelingPrep"
"Nasdaq"
],
"analysis": [
"Elect"
Expand Down
42 changes: 0 additions & 42 deletions openbb_terminal/stocks/discovery/disc_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
ark_view,
finnhub_view,
finviz_view,
fmp_view,
nasdaq_view,
seeking_alpha_view,
shortinterest_view,
Expand Down Expand Up @@ -60,7 +59,6 @@ class DiscoveryController(BaseController):
"rtat",
"divcal",
"heatmap",
"filings",
]

arkord_sortby_choices = [
Expand Down Expand Up @@ -127,7 +125,6 @@ def __init__(self, queue: Optional[List[str]] = None):
def print_help(self):
"""Print help"""
mt = MenuText("stocks/disc/")
mt.add_cmd("filings", "FinancialModelingPrep")
mt.add_cmd("pipo", "Finnhub")
mt.add_cmd("fipo", "Finnhub")
mt.add_cmd("gainers", "Yahoo Finance")
Expand Down Expand Up @@ -913,42 +910,3 @@ def call_heatmap(self, other_args: List[str]):
if ns_parser.sheet_name
else None,
)

@log_start_end(log=logger)
def call_filings(self, other_args: List[str]) -> None:
"""Process Filings command"""
parser = argparse.ArgumentParser(
add_help=False,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
prog="filings",
description="The most-recent filings submitted to the SEC",
)
parser.add_argument(
"-p",
"--pages",
dest="pages",
metavar="pages",
type=int,
default=1,
help="The number of pages to get data from (1000 entries/page; maximum 30 pages)",
)
parser.add_argument(
"-t",
"--today",
dest="today",
action="store_true",
default=False,
help="Show all filings from today",
)
if other_args and "-" not in other_args[0][0]:
other_args.insert(0, "-l")
ns_parser = self.parse_known_args_and_warn(
parser,
other_args,
EXPORT_ONLY_RAW_DATA_ALLOWED,
limit=5,
)
if ns_parser:
fmp_view.display_filings(
ns_parser.pages, ns_parser.limit, ns_parser.today, ns_parser.export
)
84 changes: 0 additions & 84 deletions openbb_terminal/stocks/discovery/fmp_view.py

This file was deleted.

51 changes: 26 additions & 25 deletions openbb_terminal/stocks/fundamental_analysis/fa_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
finviz_view,
fmp_view,
market_watch_view,
marketwatch_model,
marketwatch_view,
polygon_view,
seeking_alpha_view,
Expand Down Expand Up @@ -2019,14 +2020,23 @@ def call_sec(self, other_args: List[str]):
default=20,
help="number of latest SEC filings.",
)

parser.add_argument(
"-p",
"--pages",
dest="pages",
"-y",
"--year",
action="store",
dest="year",
type=check_positive,
default=5,
help="number of pages of SEC filings to search through, only relevant for FinancialModellingPrep.",
default=None,
help="year of SEC filings.",
)
parser.add_argument(
"-f",
"--form",
action="store",
dest="form",
type=str,
help="form group of SEC filings.",
choices=marketwatch_model.FORM_GROUP.keys(),
)

if other_args and "-" not in other_args[0][0]:
Expand All @@ -2043,25 +2053,16 @@ def call_sec(self, other_args: List[str]):
console.print(no_ticker_message)
return

if ns_parser.source == "MarketWatch":
marketwatch_view.sec_filings(
symbol=ns_parser.ticker,
limit=ns_parser.limit,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)
if ns_parser.source == "FinancialModelingPrep":
fmp_view.display_filings(
ns_parser.ticker,
ns_parser.pages,
ns_parser.limit,
ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)
marketwatch_view.sec_filings(
symbol=ns_parser.ticker,
limit=ns_parser.limit,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
year=ns_parser.year,
form_group=ns_parser.form,
)

@log_start_end(log=logger)
def call_supplier(self, other_args: List[str]):
Expand Down
66 changes: 0 additions & 66 deletions openbb_terminal/stocks/fundamental_analysis/fmp_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,72 +675,6 @@ def clean_metrics_df(data: pd.DataFrame, num: int, mask: bool = False) -> pd.Dat
return data


@log_start_end(log=logger)
@check_api_key(["API_KEY_FINANCIALMODELINGPREP"])
def get_filings(
pages: int = 1,
) -> pd.DataFrame:
"""Get SEC Filings RSS feed, disseminated by FMP

Parameters
----------
pages: range = 1
The range of most-rececnt pages to get entries from (1000 per page; maximum of 30 pages)

Returns
-------
df: pd.DataFrame
Dataframe of results

Examples
--------
df = openbb.stocks.filings()

df = openbb.stocks.filings(pages=30)
"""
current_user = get_current_user()
temp = []
try:
for i in range(pages):
temp.append(
pd.read_json(
"https://financialmodelingprep.com/api/v3/rss_feed?&page="
f"{i}"
"&apikey="
f"{current_user.credentials.API_KEY_FINANCIALMODELINGPREP}"
)
)
df = pd.concat(temp)
df = df.rename(
columns={
"title": "Title",
"date": "Date",
"link": "URL",
"cik": "CIK",
"form_type": "Form Type",
"ticker": "Ticker",
},
)
df_columns = ["Date", "Ticker", "CIK", "Form Type", "Title", "URL"]
df = (
pd.DataFrame(df, columns=df_columns)
.set_index(keys=["Date"])
.copy()
.sort_index(ascending=False)
)

# Invalid API Keys
except ValueError as e:
console.print(e)
df = pd.DataFrame()
# Premium feature, API plan is not authorized
except HTTPError as e:
console.print(e)
df = pd.DataFrame()

return df


@log_start_end(log=logger)
@check_api_key(["API_KEY_FINANCIALMODELINGPREP"])
def get_rating(symbol: str) -> pd.DataFrame:
Expand Down
Loading