Beispiel #1
0
def display_earnings(ticker: str,
                     limit: int,
                     quarterly: bool = False,
                     export: str = ""):
    """Alpha Vantage earnings

    Parameters
    ----------
    ticker : str
        Fundamental analysis ticker symbol
    limit:int
        Number of events to show
    quarterly: bool
        Flag to show quarterly instead of annual
    export: str
        Format to export data
    """
    df_fa = av_model.get_earnings(ticker, quarterly)

    if df_fa.empty:
        return

    print_rich_table(
        df_fa.head(limit),
        headers=list(df_fa.columns),
        show_index=False,
        title=f"{ticker} Earnings",
    )
    console.print("")
    export_data(export, os.path.dirname(os.path.abspath(__file__)), "earnings",
                df_fa)
Beispiel #2
0
def display_earnings(ticker: str, limit: int, quarterly: bool = False):
    """Alpha Vantage earnings

    Parameters
    ----------
    ticker : str
        Fundamental analysis ticker symbol
    limit:int
        Number of events to show
    quarterly: bool
        Flag to show quarterly instead of annual
    """
    df_fa = av_model.get_earnings(ticker, quarterly)
    if df_fa.empty:
        print("No API calls left. Try me later", "\n")
        return
    if gtff.USE_TABULATE_DF:
        print(
            tabulate(
                df_fa.head(limit),
                headers=df_fa.columns,
                showindex=False,
                tablefmt="fancy_grid",
            ))
    else:
        print(df_fa.head(n=limit).T.to_string(header=False))

    print("")
Beispiel #3
0
def display_earnings(ticker: str, limit: int, quarterly: bool = False):
    """Alpha Vantage earnings

    Parameters
    ----------
    ticker : str
        Fundamental analysis ticker symbol
    limit:int
        Number of events to show
    quarterly: bool
        Flag to show quarterly instead of annual
    """
    df_fa = av_model.get_earnings(ticker, quarterly)
    if df_fa.empty:
        console.print("No API calls left. Try me later", "\n")
        return
    print_rich_table(
        df_fa.head(limit),
        headers=list(df_fa.columns),
        show_index=False,
        title="Ticker Earnings",
    )

    console.print("")