mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 20:42:26 +00:00
Fix index command, treasury export and overview
This commit is contained in:
@@ -230,7 +230,7 @@ def show_treasuries(
|
||||
export,
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
"treasuries_data",
|
||||
treasury_data,
|
||||
treasury_data / 100,
|
||||
sheet_name,
|
||||
)
|
||||
|
||||
|
||||
@@ -900,7 +900,7 @@ class EconomyController(BaseController):
|
||||
|
||||
# display only once in the last iteration
|
||||
if i == len(indices) - 1:
|
||||
yfinance_view.show_indices(
|
||||
data = yfinance_view.show_indices(
|
||||
indices=indices,
|
||||
interval=ns_parser.interval,
|
||||
start_date=ns_parser.start_date,
|
||||
@@ -914,6 +914,8 @@ class EconomyController(BaseController):
|
||||
returns=ns_parser.returns,
|
||||
)
|
||||
|
||||
print(data)
|
||||
|
||||
self.update_runtime_choices()
|
||||
if obbff.ENABLE_EXIT_AUTO_HELP:
|
||||
self.print_help()
|
||||
|
||||
@@ -638,6 +638,7 @@ def get_index(
|
||||
interval=interval,
|
||||
progress=False,
|
||||
show_errors=False,
|
||||
ignore_tz=True,
|
||||
)
|
||||
|
||||
if column not in index_data.columns:
|
||||
@@ -712,6 +713,8 @@ def get_indices(
|
||||
for index in indices:
|
||||
indices_data[index] = get_index(index, interval, start_date, end_date, column)
|
||||
|
||||
print(indices_data)
|
||||
|
||||
if returns:
|
||||
indices_data = indices_data.pct_change().dropna()
|
||||
indices_data = indices_data + 1
|
||||
|
||||
@@ -39,7 +39,7 @@ def get_info(symbol: str) -> pd.DataFrame:
|
||||
DataFrame of yfinance information
|
||||
"""
|
||||
stock = yf.Ticker(symbol)
|
||||
df_info = pd.DataFrame(stock.info.items(), columns=["Metric", "Value"])
|
||||
df_info = pd.DataFrame(stock.fast_info.items(), columns=["Metric", "Value"])
|
||||
df_info = df_info.set_index("Metric")
|
||||
|
||||
clean_df_index(df_info)
|
||||
|
||||
Reference in New Issue
Block a user