From 23675b39b8055a8568cdcf71f66482b9d0cf90a9 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 28 Mar 2026 23:01:14 -0700 Subject: Initial commit — Prism financial analysis dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Streamlit app with market bar, price chart, financial statements, DCF valuation engine, comparable companies, and news feed. Co-Authored-By: Claude Sonnet 4.6 --- components/market_bar.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 components/market_bar.py (limited to 'components/market_bar.py') diff --git a/components/market_bar.py b/components/market_bar.py new file mode 100644 index 0000000..cb813e5 --- /dev/null +++ b/components/market_bar.py @@ -0,0 +1,25 @@ +"""Market bar — displays major indices at the top of the app.""" +import streamlit as st +from services.data_service import get_market_indices +from utils.formatters import fmt_number + + +def render_market_bar(): + indices = get_market_indices() + + cols = st.columns(len(indices)) + for col, (name, data) in zip(cols, indices.items()): + price = data.get("price") + change_pct = data.get("change_pct") + + if price is None: + col.metric(label=name, value="—") + continue + + price_str = f"{price:,.2f}" + delta_str = f"{change_pct * 100:+.2f}%" if change_pct is not None else None + col.metric( + label=name, + value=price_str, + delta=delta_str, + ) -- cgit v1.3-2-g0d8e