earnings-preview
himself65/finance-skills
Pre-earnings briefing with consensus estimates, beat/miss history, and analyst sentiment from Yahoo Finance.
What is earnings-preview?
Generates a comprehensive pre-earnings briefing using yfinance data, pulling together upcoming earnings dates, consensus EPS and revenue estimates, historical beat/miss track record, analyst ratings and price targets, and key financial context. Use this when preparing for an earnings report or when a user asks about consensus expectations, earnings setup, or what the street expects.
- Fetches upcoming earnings date and timing (before open or after close)
- Pulls consensus EPS and revenue estimates with analyst count and historical ranges
- Calculates beat/miss track record over the last four quarters with surprise percentages
- Retrieves analyst sentiment distribution (Buy/Hold/Sell ratings) and price-target ranges
- Identifies key financial metrics to watch based on recent quarterly trends and sector context
How to install earnings-preview
npx skills add https://github.com/himself65/finance-skills --skill earnings-preview- Python 3 with yfinance library (auto-installed if missing)
- Valid stock ticker symbol
How to use earnings-preview
- 1.Provide a company name or stock ticker when asking about upcoming earnings
- 2.The skill will fetch current earnings date, consensus estimates, and analyst data from Yahoo Finance
- 3.Review the five-part briefing: report date/context, consensus estimates table, beat/miss history, analyst sentiment, and key metrics to watch
- 4.Use the setup summary to understand what the street expects and where risks or opportunities lie
Use cases
- Preparing a briefing before an earnings announcement to understand consensus expectations
- Analyzing whether a company is likely to beat or miss based on historical patterns and current estimates
- Evaluating analyst sentiment and price targets ahead of a report
- Comparing consensus EPS and revenue growth expectations to identify unusual uncertainty
- Reviewing what the market will focus on in an upcoming earnings print
- Equity research analysts
- Investment professionals preparing for earnings season
- Individual investors evaluating earnings setups
- Financial advisors briefing clients on upcoming reports
earnings-preview FAQ
The skill reports missing data explicitly rather than omitting it. If consensus estimates or analyst sentiment are unavailable, it will note that in the briefing.
Consensus estimates can change until the report date, and Yahoo Finance consensus may lag real-time providers by a few hours. Always check for updates close to the earnings date.
No. For earnings that are already out, use the earnings-recap skill instead. This skill is for pre-earnings analysis only.
Surprise % is the percentage difference between actual reported EPS and the consensus estimate. Positive % means a beat; negative % means a miss.
No. This skill provides research and educational data only. It is not a recommendation to buy, sell, or hold any security.
Full instructions (SKILL.md)
Source of truth, from himself65/finance-skills.
name: earnings-preview description: > Build a pre-earnings briefing for a stock from Yahoo Finance data (yfinance): the upcoming report date and timing, consensus EPS and revenue estimates with their range, the beat/miss track record, analyst ratings and price targets, and what to watch in the print. Use this skill whenever the user is preparing for an upcoming earnings report or asks what the street expects — consensus or whisper numbers, EPS expectations, whether a company will beat, an earnings setup, or an earnings-season preview — and whenever a ticker comes up in the context of upcoming earnings, even without the word "preview". For results that are already out, use earnings-recap.
Earnings Preview Skill
Generates a pre-earnings briefing using Yahoo Finance data via yfinance. Pulls together upcoming earnings date, consensus estimates, historical accuracy, analyst sentiment, and key financial context — everything you need before an earnings call.
Important: Data is for research and educational purposes only. Not financial advice. yfinance is not affiliated with Yahoo, Inc.
Step 1: Ensure yfinance Is Available
Current environment status:
!`python3 -c "exec('try:\n import yfinance\n print(\'yfinance \' + yfinance.__version__ + \' installed\')\nexcept Exception:\n print(\'YFINANCE_NOT_INSTALLED\')')"`
If YFINANCE_NOT_INSTALLED, install it:
import subprocess, sys
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "yfinance"])
If already installed, skip to the next step.
Step 2: Identify the Ticker and Gather All Data
Extract the ticker symbol from the user's request. If they mention a company name without a ticker, look it up. Then fetch all relevant data in one script to minimize API calls.
import yfinance as yf
ticker = yf.Ticker("AAPL") # replace with actual ticker
# --- Core data ---
info = ticker.info
calendar = ticker.calendar
earnings_dates = ticker.get_earnings_dates(limit=8) # report timestamps; the upcoming one has no Reported EPS yet
hist = ticker.history(period="1mo") # recent price performance
# --- Estimates ---
earnings_est = ticker.earnings_estimate
revenue_est = ticker.revenue_estimate
# --- Historical track record ---
earnings_hist = ticker.earnings_history
# --- Analyst sentiment ---
price_targets = ticker.analyst_price_targets
recommendations = ticker.recommendations
# --- Recent financials for context ---
quarterly_income = ticker.quarterly_income_stmt
quarterly_cashflow = ticker.quarterly_cashflow
What to extract from each source
| Data Source | Key Fields | Purpose |
|---|---|---|
calendar | Earnings Date, Ex-Dividend Date | When earnings are and key dates |
get_earnings_dates() | Earnings Date (tz-aware timestamp), EPS Estimate, Reported EPS | Report timing: the upcoming row has no Reported EPS; a time at or after 16:00 ET means after the close, earlier times mean before the open |
earnings_estimate | avg, low, high, numberOfAnalysts, yearAgoEps, growth (for 0q, +1q, 0y, +1y) | Consensus EPS expectations |
revenue_estimate | avg, low, high, numberOfAnalysts, yearAgoRevenue, growth | Revenue expectations |
earnings_history | epsEstimate, epsActual, epsDifference, surprisePercent | Beat/miss track record (indexed by fiscal quarter-end, oldest first) |
analyst_price_targets | current, low, high, mean, median | Street price targets |
recommendations | Buy/Hold/Sell counts | Sentiment distribution |
quarterly_income_stmt | TotalRevenue, NetIncome, BasicEPS | Recent trajectory |
Step 3: Build the Earnings Preview
The briefing should let the user see the setup at a glance. Cover these five areas; if the data for one is missing, say so in a line rather than dropping it.
- Date and context — company, ticker, sector and industry; the report date and whether it lands before the open or after the close; current price with 1-week and 1-month performance; market cap.
- Consensus estimates — a table of this quarter's EPS and revenue consensus with low, high, analyst count, year-ago value, and expected growth. A high/low spread wider than about 20% of consensus signals unusual uncertainty; say so when you see it.
- Beat/miss track record — the last four quarters of estimated vs actual EPS with surprise %, summarized as a beat count and average surprise.
- Analyst sentiment — the rating distribution (strong buy through strong sell) and the price-target range (low, mean, median, high), with the implied upside or downside from the mean target.
- What to watch — the few things the market will focus on in this print, chosen for this company and sector: revenue growth accelerating or decelerating, margins expanding or compressing, line items that moved sharply quarter over quarter, and segment trends where the data has them. This is the judgment part of the briefing.
Step 4: Respond to the User
Open with the headline — the report date and a one-line read of the setup — then the five areas above, using tables where they help. Close with a short read of the overall setup drawn from the estimates, track record, and sentiment, framed as what the street expects rather than a recommendation.
Include the caveats that apply: estimates can change until the report date, past beats don't guarantee future ones, Yahoo Finance consensus can lag real-time providers by a few hours, and this is not financial advice.
Reference Files
references/api_reference.md— Detailed yfinance API reference for earnings and estimate methods
Read the reference file when you need exact method signatures or edge case handling.
Related skills
More from himself65/finance-skills and the wider catalog.

earnings-recap
Analyze company earnings reports with actual vs estimated EPS, surprise size, and stock price reaction using Yahoo Finance data.

estimate-analysis
Analyze analyst estimate revisions, consensus trends, and growth projections using Yahoo Finance data.

etf-premium
Calculate ETF premiums/discounts to NAV, compare across funds, and decompose sudden moves into NAV vs. structural drivers.

finance-sentiment
Fetch normalized stock sentiment from Reddit, X.com, news, and Polymarket via Adanos Finance API.

funda-data
>

generative-ui
Design system and templates for Claude's generative UI widget tool — render interactive charts, diagrams, and dashboards inline.