diff --git a/openbb_terminal/fixedincome/fixedincome_controller.py b/openbb_terminal/fixedincome/fixedincome_controller.py index 42ef8cb87e8..46e327cbfb1 100644 --- a/openbb_terminal/fixedincome/fixedincome_controller.py +++ b/openbb_terminal/fixedincome/fixedincome_controller.py @@ -1093,27 +1093,21 @@ class FixedIncomeController(BaseController): parser, other_args, EXPORT_BOTH_RAW_DATA_AND_FIGURES, raw=True ) if ns_parser: - if ns_parser.options: - print_rich_table( - pd.DataFrame.from_dict(fred_view.ICE_BOFA_TO_OPTIONS, orient='index').T.fillna("-"), - show_index=False, - title="Available options for each parameter", - ) - else: - fred_view.plot_icebofa( - data_type=ns_parser.data_type, - category=ns_parser.category, - area=ns_parser.area, - grade=ns_parser.grade, - description=ns_parser.description, - start_date=ns_parser.start_date, - end_date=ns_parser.end_date, - raw=ns_parser.raw, - export=ns_parser.export, - sheet_name=" ".join(ns_parser.sheet_name) - if ns_parser.sheet_name - else None, - ) + fred_view.plot_icebofa( + data_type=ns_parser.data_type, + category=ns_parser.category, + area=ns_parser.area, + grade=ns_parser.grade, + options=ns_parser.options, + description=ns_parser.description, + start_date=ns_parser.start_date, + end_date=ns_parser.end_date, + raw=ns_parser.raw, + export=ns_parser.export, + sheet_name=" ".join(ns_parser.sheet_name) + if ns_parser.sheet_name + else None, + ) @log_start_end(log=logger) def call_moody(self, other_args: List[str]): @@ -1261,26 +1255,20 @@ class FixedIncomeController(BaseController): parser, other_args, EXPORT_BOTH_RAW_DATA_AND_FIGURES, raw=True ) if ns_parser: - if ns_parser.options: - print_rich_table( - pd.DataFrame.from_dict(fred_view.CP_TO_OPTIONS, orient='index').T.fillna("-"), - show_index=False, - title="Available options for each parameter", - ) - else: - fred_view.plot_cp( - maturity=ns_parser.maturity, - category=ns_parser.category, - grade=ns_parser.grade, - description=ns_parser.description, - start_date=ns_parser.start_date, - end_date=ns_parser.end_date, - raw=ns_parser.raw, - export=ns_parser.export, - sheet_name=" ".join(ns_parser.sheet_name) - if ns_parser.sheet_name - else None, - ) + fred_view.plot_cp( + maturity=ns_parser.maturity, + category=ns_parser.category, + grade=ns_parser.grade, + options=ns_parser.options, + description=ns_parser.description, + start_date=ns_parser.start_date, + end_date=ns_parser.end_date, + raw=ns_parser.raw, + export=ns_parser.export, + sheet_name=" ".join(ns_parser.sheet_name) + if ns_parser.sheet_name + else None, + ) @log_start_end(log=logger) def call_spot(self, other_args: List[str]): @@ -1482,28 +1470,22 @@ class FixedIncomeController(BaseController): parser, other_args, EXPORT_BOTH_RAW_DATA_AND_FIGURES, raw=True ) if ns_parser: - if ns_parser.options: - print_rich_table( - pd.DataFrame.from_dict(fred_view.ICE_BOFA_TO_OPTIONS, orient='index').drop('Type').T.fillna("-"), - show_index=False, - title="Available options for each parameter", - ) - else: - fred_view.plot_icebofa( - data_type='spread', - category=ns_parser.category, - area=ns_parser.area, - grade=ns_parser.grade, - description=ns_parser.description, - start_date=ns_parser.start_date, - end_date=ns_parser.end_date, - raw=ns_parser.raw, - export=ns_parser.export, - sheet_name=" ".join(ns_parser.sheet_name) - if ns_parser.sheet_name - else None, - ) - + fred_view.plot_icebofa( + data_type='spread', + category=ns_parser.category, + area=ns_parser.area, + grade=ns_parser.grade, + options=ns_parser.options, + description=ns_parser.description, + start_date=ns_parser.start_date, + end_date=ns_parser.end_date, + raw=ns_parser.raw, + export=ns_parser.export, + sheet_name=" ".join(ns_parser.sheet_name) + if ns_parser.sheet_name + else None, + ) + @log_start_end(log=logger) def call_tbffr(self, other_args: List[str]): """Process tbffr command""" diff --git a/openbb_terminal/fixedincome/fred_view.py b/openbb_terminal/fixedincome/fred_view.py index 426d5f23e67..89db7b03cc0 100644 --- a/openbb_terminal/fixedincome/fred_view.py +++ b/openbb_terminal/fixedincome/fred_view.py @@ -771,7 +771,7 @@ def plot_ameribor( else: ylabel = "Yield (%)" - ax.set_title(ID_TO_NAME_AMERIBOR[series_id]) + ax.set_title(ID_TO_NAME_AMERIBOR[series_id], fontsize=15) ax.set_ylabel(ylabel) theme.style_primary_axis(ax) @@ -1837,6 +1837,7 @@ def plot_icebofa( category: str = "all", area: str = "us", grade: str = "non_sovereign", + options: bool = False, description: bool = False, start_date: Optional[str] = None, end_date: Optional[str] = None, @@ -1920,13 +1921,20 @@ def plot_icebofa( series = pd.read_excel(ice_bofa_path) + if options: + return print_rich_table( + series.drop( + ['Frequency', 'Units', 'Asset Class', 'FRED Series ID', 'Description'], axis=1) + [series['Type'].isin(['yield', 'yield_to_worst', 'total_return'] if data_type != 'spread' else ['spread'])] + ) + series = series[ (series['Type'] == data_type) & (series['Units'] == units) & (series['Frequency'] == 'daily') & - (series['Category'] == 'bonds') & - (series['Subcategory'] == category) & - (series['Region'] == area) & + (series['Asset Class'] == 'bonds') & + (series['Category'] == category) & + (series['Area'] == area) & (series['Grade'] == grade) ] @@ -2090,6 +2098,7 @@ def plot_cp( maturity: str = "30d", category: str = "financial", grade: str = "aa", + options: bool = False, description: bool = False, start_date: Optional[str] = None, end_date: Optional[str] = None, @@ -2130,6 +2139,11 @@ def plot_cp( series = pd.read_excel(commercial_paper_path) + if options: + return print_rich_table( + series.drop(['Description', 'FRED Series ID'], axis=1) + ) + series = series[ (series['Maturity'] == maturity) & (series['Category'] == category) & diff --git a/openbb_terminal/fixedincome/ice_bofa_indices.xlsx b/openbb_terminal/fixedincome/ice_bofa_indices.xlsx index cfbd81d0998..e819080c842 100644 Binary files a/openbb_terminal/fixedincome/ice_bofa_indices.xlsx and b/openbb_terminal/fixedincome/ice_bofa_indices.xlsx differ diff --git a/openbb_terminal/fixedincome/~$ice_bofa_indices.xlsx b/openbb_terminal/fixedincome/~$ice_bofa_indices.xlsx new file mode 100644 index 00000000000..5a932052db2 Binary files /dev/null and b/openbb_terminal/fixedincome/~$ice_bofa_indices.xlsx differ