Beispiel #1
0
def display_sustainability(ticker: str, export: str = ""):
    """Yahoo Finance ticker sustainability

    Parameters
    ----------
    other_args : List[str]
        argparse other args
    ticker : str
        Fundamental analysis ticker symbol
    export: str
        Format to export data
    """

    df_sustainability = yahoo_finance_model.get_sustainability(ticker)

    if df_sustainability.empty:
        console.print("No sustainability data found.", "\n")
        return

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

    export_data(
        export, os.path.dirname(os.path.abspath(__file__)), "sust", df_sustainability
    )
Beispiel #2
0
def display_sustainability(ticker: str):
    """Yahoo Finance ticker sustainability
    Parameters
    ----------
    other_args : List[str]
        argparse other args
    ticker : str
        Fundamental analysis ticker symbol
    """

    df_sustainability = yahoo_finance_model.get_sustainability(ticker)

    if df_sustainability.empty:
        console.print("No sustainability data found.", "\n")
        return

    if not df_sustainability.empty:
        print_rich_table(
            df_sustainability,
            headers=list(df_sustainability),
            title=f"{ticker.upper()} Sustainability",
            show_index=True,
        )
        console.print("")
    else:
        console.print("[red]Invalid data[/red]\n")
Beispiel #3
0
def display_sustainability(ticker: str):
    """Yahoo Finance ticker sustainability
    Parameters
    ----------
    other_args : List[str]
        argparse other args
    ticker : str
        Fundamental analysis ticker symbol
    """

    df_sustainability = yahoo_finance_model.get_sustainability(ticker)

    if df_sustainability.empty:
        print("No sustainability data found.", "\n")
        return

    if gtff.USE_TABULATE_DF:
        print(
            tabulate(
                df_sustainability,
                headers=[],
                tablefmt="fancy_grid",
                showindex=True,
            )
        )
    else:
        print(df_sustainability.to_string(index=True))
    print("")
Beispiel #4
0
def display_sustainability(ticker: str):
    """Yahoo Finance ticker sustainability
    Parameters
    ----------
    other_args : List[str]
        argparse other args
    ticker : str
        Fundamental analysis ticker symbol
    """

    df_sustainability = yahoo_finance_model.get_sustainability(ticker)

    if df_sustainability.empty:
        console.print("No sustainability data found.", "\n")
        return

    print_rich_table(
        df_sustainability,
        headers=[],
        title="Ticker Sustainability",
        show_index=True,
    )
    console.print("")