agentleFS
Jansen611Jansen611/Agent-Skills/skills/yahoo-finance-python/SKILL.md

yahoo-finance-python

Skill2 starsChanged 35 days agoMITView on GitHub

Download financial & market data from Yahoo Finance using yfinance. Supports stock quotes, historical prices, fundamentals, dividends, splits, and more.

  • Installs packages

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before using yfinance, follow this check sequence:

    line 24
  2. Distinctive:

    If found → skip to Usage.

    line 34
  3. Distinctive:

    If not found, create it:

    line 42
  4. Very specific:

    All Python code below should be run with ~/.venv/bin/python to ensure the module is available.

    line 62

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Yahoo Finance Python Skill

Fetch financial & market data from Yahoo Finance using ranaroussi/yfinance.

Pre-Check

Before using yfinance, follow this check sequence:

Step 1: Check if the yfinance module is importable

python -c "import yfinance" 2>/dev/null && echo "found" || echo "not found"
# or check in ~/.venv
~/.venv/bin/python -c "import yfinance" 2>/dev/null && echo "found in venv" || echo "not found in venv"

If found → skip to Usage.

Step 2: Check if ~/.venv exists

test -f ~/.venv/bin/python && echo "venv exists" || echo "venv not found"

If not found, create it:

python3 -m venv ~/.venv

Step 3: Install yfinance into ~/.venv

~/.venv/bin/pip install yfinance

After installation, verify:

~/.venv/bin/python -c "import yfinance; print(yfinance.__version__)"

Usage

All Python code below should be run with ~/.venv/bin/python to ensure the module is available.

Import

import yfinance as yf

Single Ticker

# Create a Ticker object
msft = yf.Ticker("MSFT")

# Get general info
info = msft.info
print(info.get("shortName"))
print(info.get("currentPrice"))
print(info.get("marketCap"))
print(info.get("sector"))

Historical Price Data

# Get historical price data
hist = msft.history(period="1mo")        # 1 day, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
hist = msft.history(start="2025-01-01", end="2025-12-31")  # date range
hist = msft.history(period="1mo", interval="1h")  # 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo

# Returns a pandas DataFrame with: Open, High, Low, Close, Volume, Dividends, Stock Splits
print(hist)

Multiple Tickers (Download)

# Download data for multiple tickers at once
data = yf.download("AAPL MSFT GOOGL", period="1mo")
print(data)

# Or with a list
tickers = ["AAPL", "MSFT", "GOOGL"]
data = yf.download(tickers, period="6mo")

Fundamentals

msft = yf.Ticker("MSFT")

# Financial statements
msft.financials         # Income statement
msft.balance_sheet      # Balance sheet
msft.cashflow           # Cash flow statement
msft.quarterly_financials
msft.quarterly_balance_sheet
msft.quarterly_cashflow

# Dividends & Splits
msft.dividends          # Dividend history
msft.splits             # Stock split history
msft.actions            # Combined dividends + splits

# Earnings
msft.earnings_dates     # Upcoming/previous earnings dates

# Institutional & major holders
msft.institutional_holders
msft.major_holders

# Analyst recommendations
msft.recommendations

Sector & Industry

# Get sector/industry info
sector = yf.Sector("technology")
print(sector.overview)

industry = yf.Industry("software-infrastructure")
print(industry.top_companies)

Search

# Search for tickers
results = yf.Search("Tesla")
print(results.quotes)    # Matching ticker quotes
print(results.news)      # Related news

Common Info Fields

msft = yf.Ticker("MSFT")
info = msft.info

# Commonly used fields:
info.get("shortName")              # "Microsoft Corporation"
info.get("currentPrice")           # Current stock price
info.get("marketCap")              # Market capitalization
info.get("sector")                 # Sector
info.get("industry")               # Industry
info.get("previousClose")          # Previous close
info.get("open")                   # Today's open
info.get("dayLow") / info.get("dayHigh")
info.get("fiftyTwoWeekLow") / info.get("fiftyTwoWeekHigh")
info.get("volume")                 # Volume
info.get("averageVolume")
info.get("dividendRate")           # Dividend rate
info.get("dividendYield")
info.get("peRatio") / info.get("forwardPE")
info.get("epsTrailingTwelveMonths") / info.get("epsForward")
info.get("beta")                   # Beta
info.get("country")
info.get("website")
info.get("longBusinessSummary")    # Company description

Saving Data to CSV

~/.venv/bin/python -c "
import yfinance as yf
data = yf.download('AAPL MSFT', period='1mo')
data.to_csv('stock_data.csv')
"

Example: Quick Stock Snapshot

~/.venv/bin/python scripts/stock_snapshot.py AAPL MSFT GOOGL

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.