def display_shareholders(ticker: str): """Yahoo Finance ticker shareholders Parameters ---------- ticker : str Fundamental analysis ticker symbol """ ( df_major_holders, df_institutional_shareholders, df_mutualfund_shareholders, ) = yahoo_finance_model.get_shareholders(ticker) dfs = [df_major_holders, df_institutional_shareholders, df_mutualfund_shareholders] titles = ["Major Holders:\n", "Institutuinal Holders:\n", "Mutual Fund Holders:\n"] print("") for df, title in zip(dfs, titles): print(title) if gtff.USE_TABULATE_DF: print( tabulate(df, headers=df.columns, tablefmt="fancy_grid", showindex=False) ) else: print(df.to_string(index=False)) print("")
def display_shareholders(ticker: str): """Yahoo Finance ticker shareholders Parameters ---------- ticker : str Fundamental analysis ticker symbol """ ( df_major_holders, df_institutional_shareholders, df_mutualfund_shareholders, ) = yahoo_finance_model.get_shareholders(ticker) df_major_holders.columns = ["", ""] dfs = [ df_major_holders, df_institutional_shareholders, df_mutualfund_shareholders ] titles = ["Major Holders", "Institutional Holders", "Mutual Fund Holders"] console.print() for df, title in zip(dfs, titles): if "Date Reported" in df.columns: df["Date Reported"] = df["Date Reported"].apply( lambda x: x.strftime("%Y-%m-%d")) print_rich_table( df, headers=list(df.columns), show_index=False, title=f"{ticker.upper()} {title}", ) console.print()
def test_get_shareholders(recorder): major_df, institutional_df, mutual_df = yahoo_finance_model.get_shareholders( ticker="AAPL" ) result_list = [major_df, institutional_df, mutual_df] recorder.capture_list(result_list)
def display_shareholders(ticker: str): """Yahoo Finance ticker shareholders Parameters ---------- ticker : str Fundamental analysis ticker symbol """ ( df_major_holders, df_institutional_shareholders, df_mutualfund_shareholders, ) = yahoo_finance_model.get_shareholders(ticker) dfs = [ df_major_holders, df_institutional_shareholders, df_mutualfund_shareholders ] titles = [ "Major Holders:\n", "Institutuinal Holders:\n", "Mutual Fund Holders:\n" ] console.print("") for df, title in zip(dfs, titles): console.print(title) print_rich_table(df, headers=list(df.columns), show_index=False, title="Ticker Shareholders") console.print("")