Пример #1
0
def display_balance_sheet(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_balance = av_model.get_balance_sheet(ticker, limit, quarterly)
    if df_balance.empty:
        console.print("No API calls left. Try me later", "\n")
        return

    print_rich_table(df_balance,
                     headers=list(df_balance.columns),
                     title="Ticker Balance Sheet")

    console.print("")
    export_data(export, os.path.dirname(os.path.abspath(__file__)), "balance",
                df_balance)
Пример #2
0
def display_balance_sheet(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_balance = av_model.get_balance_sheet(ticker, limit, quarterly)
    if df_balance.empty:
        print("No API calls left. Try me later", "\n")
        return

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

    print("")
    export_data(export, os.path.dirname(os.path.abspath(__file__)), "balance",
                df_balance)