Example #1
0
def display_income_statement(ticker: str,
                             limit: int,
                             quarterly: bool = False,
                             export: str = ""):
    """Alpha Vantage income statement

    Parameters
    ----------
    ticker : str
        Fundamental analysis ticker symbol
    limit: int
        Number of past statements
    quarterly: bool
        Flag to get quarterly instead of annual
    export: str
        Format to export data
    """
    df_income = av_model.get_income_statements(ticker, limit, quarterly)
    if df_income.empty:
        console.print("No API calls left. Try me later", "\n")
        return

    print_rich_table(df_income,
                     headers=list(df_income.columns),
                     title="Ticker Income Statement")

    console.print("")
    export_data(export, os.path.dirname(os.path.abspath(__file__)), "income",
                df_income)
Example #2
0
def display_income_statement(ticker: str,
                             limit: int,
                             quarterly: bool = False,
                             export: str = ""):
    """Alpha Vantage income statement

    Parameters
    ----------
    ticker : str
        Fundamental analysis ticker symbol
    limit: int
        Number of past statements
    quarterly: bool
        Flag to get quarterly instead of annual
    export: str
        Format to export data
    """
    df_income = av_model.get_income_statements(ticker, limit, quarterly)
    if df_income.empty:
        print("No API calls left. Try me later", "\n")
        return

    if gtff.USE_TABULATE_DF:
        print(
            tabulate(df_income,
                     headers=df_income.columns,
                     tablefmt="fancy_grid"))
    else:
        print(df_income.to_string())

    print("")
    export_data(export, os.path.dirname(os.path.abspath(__file__)), "income",
                df_income)