minor adjustments

This commit is contained in:
hjoaquim
2023-08-15 11:17:42 +01:00
parent 42f80f6716
commit 46456d474b
2 changed files with 43 additions and 41 deletions

View File

@@ -20,7 +20,7 @@ class OpenBBFigureTable(OpenBBFigure):
def show(
self,
show_index: Optional[bool] = True,
index_name: Optional[str] = "",
index_name: Optional[str] = "date",
headers: Optional[Union[List[str], pd.Index]] = None,
title: Optional[str] = "",
source: Optional[str] = "",

View File

@@ -564,28 +564,29 @@ class StocksController(StockBaseController):
if c_out.error:
console.print(f"[red]{c_out.error}[/]\n")
else:
# sheet_name = (
# " ".join(ns_parser.sheet_name) if ns_parser.sheet_name else None
# )
# export = ns_parser.export if ns_parser.export else None
sheet_name = (
" ".join(ns_parser.sheet_name) if ns_parser.sheet_name else None
)
export = ns_parser.export if ns_parser.export else None
# print_rich_table(
# df=c_out.to_dataframe(),
# show_index=True,
# title="News",
# index_name="Date",
# export=bool(export),
# )
# export_data(
# export_type=export,
# dir_path=os.path.dirname(os.path.abspath(__file__)),
# func_name="news",
# df=c_out.to_dataframe(),
# sheet_name=sheet_name,
# )
print_rich_table(
df=c_out.to_dataframe(),
show_index=True,
title="News",
index_name="Date",
export=bool(export),
print_to_console=not ns_parser.chart,
)
export_data(
export_type=export,
dir_path=os.path.dirname(os.path.abspath(__file__)),
func_name="news",
df=c_out.to_dataframe(),
sheet_name=sheet_name,
)
if ns_parser.chart:
c_out.show()
# if ns_parser.chart:
# c_out.show()
@log_start_end(log=logger)
def call_multiples(self, other_args: List[str]):
@@ -604,28 +605,29 @@ class StocksController(StockBaseController):
if c_out.error:
console.print(f"[red]{c_out.error}[/]\n")
else:
# sheet_name = (
# " ".join(ns_parser.sheet_name) if ns_parser.sheet_name else None
# )
# export = ns_parser.export if ns_parser.export else None
sheet_name = (
" ".join(ns_parser.sheet_name) if ns_parser.sheet_name else None
)
export = ns_parser.export if ns_parser.export else None
# print_rich_table(
# df=c_out.to_dataframe(),
# show_index=True,
# title=f"Multiples",
# index_name="Metric",
# export=bool(export),
# )
# export_data(
# export_type=export,
# dir_path=os.path.dirname(os.path.abspath(__file__)),
# func_name="multiples",
# df=c_out.to_dataframe(),
# sheet_name=sheet_name,
# )
print_rich_table(
df=c_out.to_dataframe(),
show_index=True,
title=f"Multiples",
index_name="Metric",
export=bool(export),
print_to_console=not ns_parser.chart,
)
export_data(
export_type=export,
dir_path=os.path.dirname(os.path.abspath(__file__)),
func_name="multiples",
df=c_out.to_dataframe(),
sheet_name=sheet_name,
)
if ns_parser.chart:
c_out.show()
# if ns_parser.chart:
# c_out.show()
@log_start_end(log=logger)
def call_disc(self, _):