diff options
Diffstat (limited to 'components/financials.py')
| -rw-r--r-- | components/financials.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/components/financials.py b/components/financials.py index 828f256..9078770 100644 --- a/components/financials.py +++ b/components/financials.py @@ -116,6 +116,13 @@ def render_financials(ticker: str): else: display, colors = _build_statement(df) st.dataframe(_style(display, colors), use_container_width=True) + st.download_button( + "Download CSV", + df.to_csv().encode(), + file_name=f"{ticker.upper()}_income_{'quarterly' if quarterly else 'annual'}.csv", + mime="text/csv", + key=f"dl_income_{ticker}_{quarterly}", + ) with tab_balance: df = get_balance_sheet(ticker, quarterly=quarterly) @@ -124,6 +131,13 @@ def render_financials(ticker: str): else: display, colors = _build_statement(df) st.dataframe(_style(display, colors), use_container_width=True) + st.download_button( + "Download CSV", + df.to_csv().encode(), + file_name=f"{ticker.upper()}_balance_{'quarterly' if quarterly else 'annual'}.csv", + mime="text/csv", + key=f"dl_balance_{ticker}_{quarterly}", + ) with tab_cashflow: df = get_cash_flow(ticker, quarterly=quarterly) @@ -132,3 +146,10 @@ def render_financials(ticker: str): else: display, colors = _build_statement(df) st.dataframe(_style(display, colors), use_container_width=True) + st.download_button( + "Download CSV", + df.to_csv().encode(), + file_name=f"{ticker.upper()}_cashflow_{'quarterly' if quarterly else 'annual'}.csv", + mime="text/csv", + key=f"dl_cashflow_{ticker}_{quarterly}", + ) |
