def display_cash_flow(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_cash = av_model.get_cash_flow(ticker, limit, quarterly) if df_cash.empty: console.print("No API calls left. Try me later", "\n") return print_rich_table(df_cash, headers=list(df_cash.columns), title="Ticker Balance Sheet") console.print("") export_data(export, os.path.dirname(os.path.abspath(__file__)), "cash", df_cash)
def display_cash_flow(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_cash = av_model.get_cash_flow(ticker, limit, quarterly) if df_cash.empty: print("No API calls left. Try me later", "\n") return if gtff.USE_TABULATE_DF: print(tabulate(df_cash, headers=df_cash.columns, tablefmt="fancy_grid")) else: print(df_cash.to_string()) print("") export_data(export, os.path.dirname(os.path.abspath(__file__)), "cash", df_cash)