Fix index command, treasury export and overview

This commit is contained in:
jeroen
2023-02-08 10:10:23 +01:00
parent 46e7eee557
commit e8049c69fc
4 changed files with 8 additions and 3 deletions

View File

@@ -230,7 +230,7 @@ def show_treasuries(
export,
os.path.dirname(os.path.abspath(__file__)),
"treasuries_data",
treasury_data,
treasury_data / 100,
sheet_name,
)

View File

@@ -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()

View File

@@ -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

View File

@@ -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)