US Stock Financial Analyzer
Analyze S&P 500 and NASDAQ stock financial data through automated indicator computation, peer benchmarking, and structured reporting.
Workflow
- Fetch data — Run
scripts/fetch_financials.pyto pull financial statements via yfinance. - Compute indicators — Run
scripts/compute_indicators.pyto calculate key ratios and scores. - Benchmark — Run
scripts/benchmark.pyto compare against sector/industry peers. - Report — Synthesize results into a structured summary.
For full indicator definitions and formulas, see references/indicators.md.
Quick Start
Single-stock analysis
python3 scripts/fetch_financials.py AAPL
python3 scripts/compute_indicators.py AAPL
Peer benchmarking
python3 scripts/benchmark.py AAPL --index sp500
python3 scripts/benchmark.py MSFT --index nasdaq
Batch screening
python3 scripts/fetch_financials.py AAPL MSFT GOOGL --batch
python3 scripts/compute_indicators.py --screen "pe<25;roe>15;de<1.5" --index sp500
Output Format
All scripts output JSON to stdout. Pipe to jq or redirect to file:
python3 scripts/compute_indicators.py AAPL | jq '.valuation'
Key Indicators
| Category | Indicators |
|---|---|
| Valuation | PE, PB, PS, PEG, EV/EBITDA |
| Profitability | ROE, ROA, Gross Margin, Net Margin |
| Leverage | D/E, Interest Coverage, Equity Ratio |
| Growth | Revenue CAGR, EPS Growth, FCF Growth |
| Liquidity | Current Ratio, Quick Ratio |
Full formulas in references/indicators.md.
Dependencies
Requires: yfinance, pandas, numpy. Install via:
pip install yfinance pandas numpy