diff options
Diffstat (limited to 'readme')
| -rw-r--r-- | readme | 141 |
1 files changed, 141 insertions, 0 deletions
@@ -0,0 +1,141 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +<meta charset="UTF-8"> +<style> + body { font-family: sans-serif; max-width: 800px; line-height: 1.6; } + code, pre { font-family: monospace; background: #f4f4f4; padding: 0.2em 0.4em; border-radius: 3px; } + pre { padding: 0.75em 1em; overflow-x: auto; } + pre code { background: none; padding: 0; } + table { border-collapse: collapse; width: 100%; } + th, td { border: 1px solid #ccc; padding: 0.4em 0.75em; text-align: left; } + th { background: #f0f0f0; } +</style> +</head> +<body> +<h1>🔷 Prism</h1> +<p>A local financial analysis dashboard. Enter any stock ticker to get a formatted view of financial statements, valuation metrics, a DCF model, and a news feed — all in your browser.</p> +<hr /> +<h2>Features</h2> +<ul> +<li><strong>Market Bar</strong> — Live S&P 500, NASDAQ, DOW, and VIX at the top of every page</li> +<li><strong>Overview</strong> — Price chart (1M / 3M / 6M / 1Y / 5Y), key stats (market cap, P/E, 52W range, beta)</li> +<li><strong>Financials</strong> — Annual and quarterly Income Statement, Balance Sheet, and Cash Flow Statement with year-over-year % change columns</li> +<li><strong>Valuation</strong> — Key ratios grid (P/E, EV/EBITDA, margins, ROE, etc.), interactive DCF model with adjustable WACC and growth rate, comparable companies table</li> +<li><strong>News</strong> — Recent articles with Bullish / Bearish / Neutral sentiment badges and a 7-day sentiment summary</li> +</ul> +<hr /> +<h2>Setup</h2> +<h3>1. Clone / navigate to the project</h3> +<pre><code class="language-bash">cd ~/Work/prism +</code></pre> +<h3>2. Activate the virtual environment</h3> +<pre><code class="language-bash">source .venv/bin/activate +</code></pre> +<h3>3. Add API keys</h3> +<pre><code class="language-bash">cp .env.example .env +</code></pre> +<p>Open <code>.env</code> and fill in your keys:</p> +<pre><code>FMP_API_KEY=your_key_here +FINNHUB_API_KEY=your_key_here +</code></pre> +<p>Both are <strong>free</strong>: +- <strong>FMP</strong> (Financial Modeling Prep) — <a href="https://financialmodelingprep.com/developer/docs">financialmodelingprep.com</a> — 250 requests/day +- <strong>Finnhub</strong> — <a href="https://finnhub.io">finnhub.io</a> — 60 requests/minute</p> +<blockquote> +<p><strong>No keys?</strong> The app still works. Price data, financials, and market indices are sourced from <code>yfinance</code> (no key required). Ratios, comps, and news won't load until keys are added.</p> +</blockquote> +<h3>4. Run the app</h3> +<pre><code class="language-bash">streamlit run app.py +</code></pre> +<p>Opens at <code>http://localhost:8501</code></p> +<hr /> +<h2>Daily Usage</h2> +<pre><code class="language-bash">cd ~/Work/prism +source .venv/bin/activate +streamlit run app.py +</code></pre> +<hr /> +<h2>Project Structure</h2> +<pre><code>prism/ +├── app.py # Entry point +├── requirements.txt +├── .env # Your API keys (not committed) +├── .env.example # Key template +├── .streamlit/ +│ └── config.toml # Dark theme + layout settings +├── services/ +│ ├── data_service.py # yfinance — price, financials, indices +│ ├── fmp_service.py # FMP API — ratios, peers +│ ├── news_service.py # Finnhub — news + sentiment +│ └── valuation_service.py # DCF engine (Gordon Growth Model) +├── components/ +│ ├── market_bar.py # Index metrics row +│ ├── overview.py # Company header + price chart +│ ├── financials.py # Statement tables +│ ├── valuation.py # Ratios, DCF, comps +│ └── news.py # News feed +└── utils/ + └── formatters.py # Number formatting helpers +</code></pre> +<hr /> +<h2>DCF Model Notes</h2> +<p>The DCF model uses <strong>5 years of historical Free Cash Flow</strong> from yfinance to compute an average growth rate, then projects forward using your chosen assumptions:</p> +<table> +<thead> +<tr> +<th>Input</th> +<th>Default</th> +<th>Range</th> +</tr> +</thead> +<tbody> +<tr> +<td>WACC</td> +<td>10%</td> +<td>5–20%</td> +</tr> +<tr> +<td>Terminal Growth Rate</td> +<td>2.5%</td> +<td>0.5–5%</td> +</tr> +<tr> +<td>Projection Years</td> +<td>5</td> +<td>3–10</td> +</tr> +</tbody> +</table> +<p>The model uses the <strong>Gordon Growth Model</strong> for terminal value. Intrinsic value per share is compared against the current market price to show upside/downside.</p> +<hr /> +<h2>API Rate Limits</h2> +<table> +<thead> +<tr> +<th>Source</th> +<th>Limit</th> +<th>Used For</th> +</tr> +</thead> +<tbody> +<tr> +<td>yfinance</td> +<td>None</td> +<td>Price, financials, indices</td> +</tr> +<tr> +<td>FMP (free)</td> +<td>250 req/day</td> +<td>Ratios, comps, news</td> +</tr> +<tr> +<td>Finnhub (free)</td> +<td>60 req/min</td> +<td>News, sentiment</td> +</tr> +</tbody> +</table> +<p>Data is cached in-memory per session to minimize API calls (financials: 1h, news: 10min, indices: 5min).</p> +</body> +</html>
\ No newline at end of file |
