Exemplo n.º 1
0
def display_info(ticker: str, export: str = ""):
    """Yahoo Finance ticker info
    Parameters
    ----------
    ticker : str
        Fundamental analysis ticker symbol
    export: str
        Format to export data
    """
    summary = ""
    df_info = yahoo_finance_model.get_info(ticker)
    if "Long business summary" in df_info.index:
        summary = df_info.loc["Long business summary"].values[0]
        df_info = df_info.drop(index=["Long business summary"])

    if not df_info.empty:
        print_rich_table(
            df_info,
            headers=list(df_info.columns),
            show_index=True,
            title=f"{ticker.upper()} Info",
        )
    else:
        logger.error("Invalid data")
        console.print("[red]Invalid data[/red]\n")
        return

    if summary:
        console.print("Business Summary:")
        console.print(summary)

    console.print("")
    export_data(export, os.path.dirname(os.path.abspath(__file__)), "info", df_info)
Exemplo n.º 2
0
def display_info(ticker: str):
    """Yahoo Finance ticker info
    Parameters
    ----------
    ticker : str
        Fundamental analysis ticker symbol
    """
    summary = ""
    df_info = yahoo_finance_model.get_info(ticker)
    if "Long business summary" in df_info.index:
        summary = df_info.loc["Long business summary"].values[0]
        df_info = df_info.drop(index=["Long business summary"])

    if not df_info.empty:
        print_rich_table(
            df_info,
            headers=list(df_info.columns),
            show_index=True,
            title=f"{ticker.upper()} Info",
        )
    else:
        console.print("[red]Invalid data[/red]\n")
    if summary:
        console.print("Business Summary:")
        console.print(summary)

    console.print("")
Exemplo n.º 3
0
def display_info(ticker: str):
    """Yahoo Finance ticker info
    Parameters
    ----------
    ticker : str
        Fundamental analysis ticker symbol
    """
    summary = ""
    df_info = yahoo_finance_model.get_info(ticker)
    if "Long business summary" in df_info.index:
        summary = df_info.loc["Long business summary"].values[0]
        df_info = df_info.drop(index=["Long business summary"])

    print_rich_table(df_info, headers=[], show_index=True, title="Ticker Info")

    if summary:
        console.print("Business Summary:")
        console.print(summary)

    console.print("")
Exemplo n.º 4
0
def display_info(ticker: str):
    """Yahoo Finance ticker info
    Parameters
    ----------
    ticker : str
        Fundamental analysis ticker symbol
    """
    summary = ""
    df_info = yahoo_finance_model.get_info(ticker)
    if "Long business summary" in df_info.index:
        summary = df_info.loc["Long business summary"].values[0]
        df_info = df_info.drop(index=["Long business summary"])

    if gtff.USE_TABULATE_DF:
        print(tabulate(df_info, headers=[], showindex=True, tablefmt="fancy_grid"))

    else:
        print(df_info.to_string(header=False))

    if summary:
        print("Business Summary:")
        print(summary)

    print("")