Financial Data Collector
Collect + validate real financial data for US public companies (free sources). Output: standardized JSON for downstream financial skills.
Critical constraints
- NO FALLBACK values: if a field can't be retrieved, set
null + _source: "missing". Never substitute defaults (beta or 1.0). Downstream decides.
- Source attribution mandatory: every section has a
_source.
- CapEx sign: yfinance returns negative (outflow). Preserve original sign; document convention; do NOT flip.
- yfinance FCF ≠ IB FCF: yfinance FCF = OperatingCF + CapEx, no SBC deduction. Flag in metadata (for mega-caps SBC is $20-30B/yr → ~30% overstatement).
Workflow
python scripts/collect_data.py TICKER [--years 5] [--output path.json] — priority: yfinance (market/financials/beta/estimates) → yfinance ^TNX (10Y Treasury = risk-free proxy) → user supplement for NaN years (report, don't guess).
python scripts/validate_data.py path.json — completeness, cross-field (MktCap = Price×Shares), range sanity (WACC 5-20%, beta 0.3-3.0), sign conventions.
- Deliver single file
{TICKER}_financial_data.json. Do NOT create README/CSV/summary.
Output sections
market_data, income_statement (per year), cash_flow, balance_sheet, wacc_inputs, analyst_estimates, metadata (with _capex_convention, _fcf_note).
Correct patterns
- Missing year:
if pd.isna(revenue): result[year] = {"revenue": None, "_source": "yfinance NaN — supplement from 10-K"}. Report, don't skip/fill.
- CapEx:
float(cash_flow.loc["Capital Expenditure", col]) preserve negative.
- Datetime cols:
[c for c in financials.columns if c.year == target][0].
- Field guards: try
"Total Revenue" then "Revenue" else None.
Mistakes to avoid
Default values for missing data; assuming all years have data; using yfinance FCF directly in DCF; flipping CapEx sign (abs() → double-negation downstream).
1---2name: financial-data-collector-yfinance3description: Use when collecting real financial data for a US public company (price, financials, WACC inputs, analyst estimates) into structured JSON for DCF/comps/earnings analysis — enforces NO FALLBACK, sign conventions, and validation.4tags: [yfinance, financial-data, dcf, wacc, market-data, json, no-fallback, validation, capex]5source: daymade/claude-code-skills6derived_from: financial-data-collector7metadata:8 source: https://skillmd.com/skills/aashutosh396/financial-data-collector-yfinance9---1011# Financial Data Collector1213Collect + validate real financial data for US public companies (free sources). Output: standardized JSON for downstream financial skills.1415## Critical constraints16- **NO FALLBACK values**: if a field can't be retrieved, set `null` + `_source: "missing"`. Never substitute defaults (`beta or 1.0`). Downstream decides.17- **Source attribution mandatory**: every section has a `_source`.18- **CapEx sign**: yfinance returns negative (outflow). Preserve original sign; document convention; do NOT flip.19- **yfinance FCF ≠ IB FCF**: yfinance FCF = OperatingCF + CapEx, no SBC deduction. Flag in metadata (for mega-caps SBC is $20-30B/yr → ~30% overstatement).2021## Workflow221. `python scripts/collect_data.py TICKER [--years 5] [--output path.json]` — priority: yfinance (market/financials/beta/estimates) → yfinance `^TNX` (10Y Treasury = risk-free proxy) → user supplement for NaN years (report, don't guess).232. `python scripts/validate_data.py path.json` — completeness, cross-field (MktCap = Price×Shares), range sanity (WACC 5-20%, beta 0.3-3.0), sign conventions.243. Deliver single file `{TICKER}_financial_data.json`. Do NOT create README/CSV/summary.2526## Output sections27`market_data`, `income_statement` (per year), `cash_flow`, `balance_sheet`, `wacc_inputs`, `analyst_estimates`, `metadata` (with `_capex_convention`, `_fcf_note`).2829## Correct patterns30- Missing year: `if pd.isna(revenue): result[year] = {"revenue": None, "_source": "yfinance NaN — supplement from 10-K"}`. Report, don't skip/fill.31- CapEx: `float(cash_flow.loc["Capital Expenditure", col])` preserve negative.32- Datetime cols: `[c for c in financials.columns if c.year == target][0]`.33- Field guards: try `"Total Revenue"` then `"Revenue"` else None.3435## Mistakes to avoid36Default values for missing data; assuming all years have data; using yfinance FCF directly in DCF; flipping CapEx sign (`abs()` → double-negation downstream).