Earnings Preview
Alex YangCommunityCreated by Alex Yang
- Skill
- Tool integration
- Business and productivity
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The Earnings Preview skill provides a structured, data-driven briefing for upcoming corporate earnings reports. By leveraging the yfinance library, it aggregates critical information including report timing, consensus EPS and revenue estimates, historical beat/miss performance, and analyst sentiment. Designed for investors and analysts, it synthesizes complex financial data into a clear, actionable summary to help users understand market expectations before a company reports its quarterly results.
What it does
- Identifies upcoming earnings report dates and timing relative to market hours.
- Summarizes consensus EPS and revenue estimates with high/low ranges.
- Analyzes historical beat/miss track records over the last four quarters.
- Aggregates analyst price targets and recommendation distributions.
- Provides recent financial context to highlight key trends in revenue and margins.
- Offers a synthesized view of what the market is watching for in the upcoming print.
When to use it
- When preparing for an upcoming earnings report for a specific stock.
- When you need to know what the street expects regarding EPS or revenue.
- When evaluating a company's historical ability to beat or miss earnings estimates.
- When assessing current analyst sentiment and price target ranges for a ticker.
- When you want a quick, structured overview of an earnings setup before the call.
Advantages
- Consolidates fragmented financial data into a single, readable briefing.
- Provides objective, data-backed insights into market expectations.
- Helps identify unusual uncertainty through high/low estimate spreads.
- Saves time by automating the extraction of data from multiple financial sources.
Usage examples
- “What is the earnings setup for Apple (AAPL) ahead of their next report?”
- The agent retrieves the next earnings date, consensus EPS/revenue estimates, historical surprise data, and current analyst sentiment to provide a full briefing.
- “Do analysts expect Nvidia to beat earnings this quarter?”
- The agent analyzes the current consensus estimates against historical performance and analyst ratings to summarize the market's outlook.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/himself65/earnings-preview/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip earnings-preview.zip -d .agents/skills
Documentation by Alex Yang
Earnings Preview Skill
If your host has not already executed the shell probes below (for example, in Codex), run the commands inside the ! wrappers with its shell tool before choosing a setup path. Use the actual output; if shell access is unavailable, report that limitation.
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_cashflowWhat 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.
Files
- ATTRIBUTION.mdAdded by AutoGineer893 B
- LICENSELicence file added by AutoGineer1.0 KiB
- README.md1.1 KiB
- SKILL.md5.9 KiB
- references/api_reference.md4.7 KiB
references/api_reference.md
Earnings Preview — yfinance API Reference
Detailed reference for the yfinance methods used by the earnings-preview skill.
Calendar
ticker.calendarReturns a dictionary with upcoming events:
Earnings Date— list of datetime objects (usually a range like [start, end])Ex-Dividend Date— next ex-dividend dateDividend Date— next dividend payment date
Edge cases:
Some tickers return an empty dict if no upcoming events are scheduled
Earnings dates may show as a 2-day range (the company hasn't specified exact date/time)
Earnings Estimate
ticker.earnings_estimateReturns a DataFrame indexed by period:
0q— current quarter+1q— next quarter0y— current year+1y— next year
Columns:
numberOfAnalysts— number of analysts coveringavg— consensus average EPSlow— lowest estimatehigh— highest estimateyearAgoEps— EPS from the same period last yeargrowth— expected growth rate (decimal, e.g., 0.127 = 12.7%)
Revenue Estimate
ticker.revenue_estimateSame structure as earnings_estimate but for revenue:
numberOfAnalysts,avg,low,high,yearAgoRevenue,growth
Note: Revenue figures are in raw numbers (not millions/billions). Format appropriately for display.
Earnings History
ticker.earnings_historyReturns a DataFrame with the last 4 quarters of actual vs estimated earnings:
Columns:
epsEstimate— consensus EPS estimate at the timeepsActual— reported EPSepsDifference— actual minus estimatesurprisePercent— surprise as a percentage (decimal)
Index (quarter) is the fiscal quarter-end date, oldest first — not the announcement date. Use ticker.get_earnings_dates() for report timestamps.
Note: surprisePercent is already in decimal form (0.037 = 3.7%). Multiply by 100 for display.
Earnings Dates
ticker.get_earnings_dates(limit=8)Returns a DataFrame indexed by Earnings Date — tz-aware announcement timestamps (America/New_York), newest first, including the next scheduled report.
Columns: EPS Estimate, Reported EPS, Surprise(%) (already in percent, e.g. 6.74).
The upcoming report is the row with no
Reported EPS.The time of day (US Eastern) gives the timing: at or after 16:00 means after the close; earlier times mean before the open, or occasionally during the session.
Analyst Price Targets
ticker.analyst_price_targetsReturns a dictionary:
current— current pricelow— lowest analyst targethigh— highest analyst targetmean— average targetmedian— median target
Recommendations
ticker.recommendationsReturns a DataFrame with recommendation counts by period. Columns typically:
strongBuy,buy,hold,sell,strongSellIndex represents the period
Use the most recent row for current analyst sentiment distribution.
Quarterly Financial Statements
ticker.quarterly_income_stmt # Income statement
ticker.quarterly_balance_sheet # Balance sheet
ticker.quarterly_cashflow # Cash flowEach returns a DataFrame with financial line items as rows and quarter dates as columns (most recent first).
Key income statement rows for earnings preview:
Total RevenueGross ProfitOperating IncomeNet IncomeBasic EPS/Diluted EPSEBITDA
Tip: Compare the last 2-4 quarters to identify trends in revenue growth, margin expansion/compression, and EPS trajectory.
Company Info
ticker.infoKey fields for context:
shortName— company namesector,industry— classificationmarketCap— market capitalizationcurrentPrice— current stock pricepreviousClose— last closing pricetrailingPE,forwardPE— P/E ratiosfiftyTwoWeekHigh,fiftyTwoWeekLow— 52-week range
Historical Prices (for recent performance)
# 1-month performance
hist = ticker.history(period="1mo")
# 1-week performance
hist = ticker.history(period="5d")Use to calculate % change for recent performance context.
Error Handling
Always wrap data fetches in try/except:
try:
data = ticker.earnings_estimate
if data is None or (hasattr(data, 'empty') and data.empty):
print("No earnings estimate data available")
except Exception as e:
print(f"Error: {e}")Common issues:
No calendar data: Company hasn't announced next earnings date
Empty estimates: Ticker may not have analyst coverage (small caps, foreign stocks)
Stale data: Yahoo Finance estimates may not update in real-time; note this to the user
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs Python
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Alex Yang
- Publisher
- Alex Yang (Community)
- Source
- himself65/finance-skills · plugins/market-analysis/skills/earnings-preview · commit a085078
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Alex Yang.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download earnings-preview.zip