Home/Accounting/earnings-recap
E

earnings-recap

by @himself65v
4.2(20)

Post-earnings analysis covering actual vs estimated EPS, price reaction, and margin trends

earnings-recapfinanceanalysisGitHub
Installation
npx skills add himself65/finance-skills
compare_arrows

Before / After Comparison

1
Before

Manually collecting data and reports, slow and error-prone

After

One-click professional analysis with real-time data across multiple dimensions

SKILL.md

Earnings Recap Skill

Generates a post-earnings analysis using Yahoo Finance data via yfinance. Covers the actual vs estimated numbers, surprise magnitude, stock price reaction, and financial context — a complete picture of what happened.

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 "import yfinance; print('yfinance ' + yfinance.__version__ + ' installed')" 2>/dev/null || echo "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 Data

Extract the ticker from the user's request. Fetch all relevant post-earnings data in one script.

import yfinance as yf
import pandas as pd
from datetime import datetime, timedelta

ticker = yf.Ticker("AAPL")  # replace with actual ticker

# --- Earnings result ---
earnings_hist = ticker.earnings_history

# --- Financial statements ---
quarterly_income = ticker.quarterly_income_stmt
quarterly_cashflow = ticker.quarterly_cashflow
quarterly_balance = ticker.quarterly_balance_sheet

# --- Price reaction ---
# Get ~30 days of history to capture the reaction window
hist = ticker.history(period="1mo")

# --- Context ---
info = ticker.info
news = ticker.news
recommendations = ticker.recommendations

What to extract

Data SourceKey FieldsPurpose
earnings_historyepsEstimate, epsActual, epsDifference, surprisePercentBeat/miss result
quarterly_income_stmtTotalRevenue, GrossProfit, OperatingIncome, NetIncome, BasicEPSActual financials
history()Close prices around earnings dateStock price reaction
infocurrentPrice, marketCap, forwardPECurrent context
newsRecent headlinesEarnings-related news

Step 3: Determine the Most Recent Earnings

The most recent earnings result is the first row (most recent date) in earnings_history. Use its date to:

  1. Identify the earnings date for the price reaction analysis
  2. Match to the corresponding quarter in the financial statements
  3. Calculate stock price reaction — compare the close before earnings to the next trading day's close (or open, depending on whether earnings were before/after market)

Price reaction calculation

import numpy as np

# Find the earnings date from earnings_history index
earnings_date = earnings_hist.index[0]  # most recent

# Get daily prices around the earnings date
hist_extended = ticker.history(start=earnings_date - timedelta(days=5),
                                end=earnings_date + timedelta(days=5))

# The reaction is typically measured as:
# - Close on the last trading day before earnings -> Close on the first trading day after
# Be careful with before/after market reports
if len(hist_extended) >= 2:
    pre_price = hist_extended['Close'].iloc[0]
    post_price = hist_extended['Close'].iloc[-1]
    reaction_pct = ((post_price - pre_price) / pre_price) * 100

Note: The exact reaction window depends on when the company reported (before market open vs after close). The price data will reflect this — look for the biggest gap between consecutive closes near the earnings date.


Step 4: Build the Earnings Recap

Section 1: Headline Result

Lead with the key numbers:

  • EPS: Actual vs. Estimate, beat/miss by how much, surprise %
  • Revenue: Actual vs. prior year (from quarterly_income_stmt TotalRevenue)
  • Stock reaction: % move on earnings day

Example: "AAPL beat Q3 EPS estimates by 3.7% ($1.40 actual vs $1.35 expected). Revenue grew 5.4% YoY to $94.3B. The stock rose +2.1% on the report."

Section 2: Earnings vs. Estimates Detail

MetricEstimateActualSurprise
EPS$1.35$1.40+$0.05 (+3.7%)

If the user asked about a specific quar

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs587
Rating4.2 / 5.0
Version
Updated2026年5月23日
Comparisons1

User Rating

4.2(20)
5
50%
4
50%
3
0%
2
0%
1
0%

Rate this Skill

0.0

Compatible Platforms

🔧Claude Code

Timeline

Created2026年4月6日
Last Updated2026年5月23日