
stock-screener
Filter and screen stocks by financial metrics like P/E ratio, market cap, dividend yield, and growth rates. Analyze and compare stocks from CSV data.
- Installs
- 183
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/dkyazzentwatwa/chatgpt-skills --skill stock-screener- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads stock-screener automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Stock Screener
Filter stocks by financial metrics and perform comparative analysis.
Features
- Multi-Metric Filtering: P/E, P/B, market cap, dividend yield, etc.
- Custom Screens: Save and reuse filter combinations
- Comparative Analysis: Side-by-side stock comparison
- Sector Analysis: Group and analyze by sector
- Ranking: Score and rank stocks by criteria
- Export: CSV, JSON, formatted reports
Quick Start
from stock_screener import StockScreener
screener = StockScreener()
# Load stock data
screener.load_csv("stocks.csv")
# Apply filters
results = screener.filter(
pe_ratio=(0, 20),
market_cap_min=1e9,
dividend_yield_min=2.0
)
print(results)
CLI Usage
# Basic screening
python stock_screener.py --input stocks.csv --pe-max 20 --div-min 2.0
# Multiple filters
python stock_screener.py --input stocks.csv --pe 5 25 --pb-max 3 --cap-min 1B
# Sector filter
python stock_screener.py --input stocks.csv --sector Technology --pe-max 30
# Rank by metric
python stock_screener.py --input stocks.csv --rank-by dividend_yield --top 20
# Compare specific stocks
python stock_screener.py --input stocks.csv --compare AAPL MSFT GOOGL
# Export results
python stock_screener.py --input stocks.csv --pe-max 15 --output screened.csv
Input Format
Stock CSV
symbol,name,sector,price,pe_ratio,pb_ratio,market_cap,dividend_yield,eps,revenue_growth,profit_margin
AAPL,Apple Inc,Technology,175.50,28.5,45.2,2.8e12,0.5,6.16,8.5,25.3
MSFT,Microsoft,Technology,380.00,35.2,12.8,2.8e12,0.8,10.79,12.3,36.7
JNJ,Johnson & Johnson,Healthcare,155.00,15.2,5.8,3.8e11,2.9,10.20,5.2,22.1
API Reference
StockScreener Class
class StockScreener:
def __init__(self)
# Data Loading
def load_csv(self, filepath: str) -> 'StockScreener'
def load_dataframe(self, df: pd.DataFrame) -> 'StockScreener'
# Filtering
def filter(self, **criteria) -> pd.DataFrame
def filter_by_sector(self, sectors: List[str]) -> 'StockScreener'
def filter_by_metric(self, metric: str, min_val: float = None,
max_val: float = None) -> 'StockScreener'
# Screening Presets
def value_screen(self) -> pd.DataFrame
def growth_screen(self) -> pd.DataFrame
def dividend_screen(self) -> pd.DataFrame
def quality_screen(self) -> pd.DataFrame
def custom_screen(self, criteria: Dict) -> pd.DataFrame
# Analysis
def compare(self, symbols: List[str]) -> pd.DataFrame
def rank_by(self, metric: str, ascending: bool = True) -> pd.DataFrame
def sector_summary(self) -> pd.DataFrame
def metric_distribution(self, metric: str) -> Dict
# Scoring
def score_stocks(self, weights: Dict[str, float] = None) -> pd.DataFrame
def percentile_rank(self, metrics: List[str]) -> pd.DataFrame
# Export
def to_csv(self, filepath: str) -> str
def to_json(self, filepath: str) -> str
def summary_report(self) -> str
Filtering Criteria
Valuation Metrics
screener.filter(
pe_ratio=(5, 20), # P/E between 5 and 20
pb_ratio_max=3.0, # P/B ratio under 3
ps_ratio_max=5.0, # Price/Sales under 5
peg_ratio_max=1.5 # PEG ratio under 1.5
)
Size Metrics
screener.filter(
market_cap_min=1e9, # Min $1B market cap
market_cap_max=10e9, # Max $10B (mid-cap)
revenue_min=500e6 # Min $500M revenue
)
Income Metrics
screener.filter(
dividend_yield_min=2.0, # Min 2% dividend
dividend_yield_max=8.0, # Max 8% (avoid yield traps)
payout_ratio_max=75 # Sustainable payout
)
Growth Metrics
screener.filter(
revenue_growth_min=10, # Min 10% revenue growth
earnings_growth_min=15, # Min 15% earnings growth
eps_growth_min=10 # Min 10% EPS growth
)
Quality Metrics
screener.filter(
profit_margin_min=15, # Min 15% profit margin
roe_min=15, # Min 15% return on equity
debt_to_equity_max=1.0, # Max 1.0 D/E ratio
current_ratio_min=1.5 # Min 1.5 current ratio
)
Preset Screens
Value Screen
results = screener.value_screen()
# Finds undervalued stocks:
# - P/E < 15
# - P/B < 2
# - Dividend yield > 2%
# - Profit margin > 10%
Growth Screen
results = screener.growth_screen()
# Finds growth stocks:
# - Revenue growth > 15%
# - Earnings growth > 20%
# - PEG ratio < 2
Dividend Screen
results = screener.dividend_screen()
# Finds dividend stocks:
# - Dividend yield 2-8%
# - Payout ratio < 75%
# - 5+ years dividend history
Quality Screen
results = screener.quality_screen()
# Finds high-quality stocks:
# - ROE > 15%
# - Profit margin > 15%
# - D/E < 0.5
# - Current ratio > 2
Stock Comparison
comparison = screener.compare(["AAPL", "MSFT", "GOOGL"])
# Returns:
# AAPL MSFT GOOGL
# price 175.50 380.00 140.00
# pe_ratio 28.50 35.20 25.30
# market_cap 2.8T 2.8T 1.7T
# dividend_yield 0.50 0.80 0.00
# profit_margin 25.30 36.70 22.50
# ...
Ranking and Scoring
Rank by Single Metric
# Top 20 by dividend yield
top_dividend = screener.rank_by("dividend_yield", ascending=False).head(20)
Composite Scoring
# Score stocks with custom weights
scores = screener.score_stocks({
"pe_ratio": -0.2, # Lower is better
"dividend_yield": 0.3, # Higher is better
"profit_margin": 0.3, # Higher is better
"revenue_growth": 0.2 # Higher is better
})
# Returns stocks ranked by composite score
Percentile Ranking
# See where each stock ranks on multiple metrics
ranked = screener.percentile_rank(["pe_ratio", "dividend_yield", "profit_margin"])
# Returns percentile (0-100) for each metric
Sector Analysis
sector_stats = screener.sector_summary()
# Returns:
# sector | count | avg_pe | avg_div | avg_margin
# Technology | 45 | 28.5 | 1.2 | 22.3
# Healthcare | 32 | 18.2 | 2.1 | 18.7
# Financials | 28 | 12.5 | 3.2 | 25.1
Example Workflows
Find Undervalued Dividend Stocks
screener = StockScreener()
screener.load_csv("sp500.csv")
# Apply filters
results = screener.filter(
pe_ratio=(5, 15),
dividend_yield_min=3.0,
payout_ratio_max=70,
profit_margin_min=10
)
# Rank by dividend yield
top = results.sort_values("dividend_yield", ascending=False).head(10)
print(top[["symbol", "name", "pe_ratio", "dividend_yield", "payout_ratio"]])
Growth at Reasonable Price (GARP)
results = screener.filter(
revenue_growth_min=15,
earnings_growth_min=15,
peg_ratio_max=1.5,
pe_ratio_max=25
)
Sector Comparison
# Filter to technology sector
tech = screener.filter_by_sector(["Technology"]).filter(
market_cap_min=10e9,
profit_margin_min=15
)
# Compare top tech stocks
comparison = screener.compare(tech["symbol"].head(5).tolist())
Output Format
CSV Export
screener.filter(pe_ratio_max=20).to_csv("value_stocks.csv")
JSON Export
screener.filter(dividend_yield_min=3).to_json("dividend_stocks.json")
Summary Report
report = screener.summary_report()
# Returns formatted text summary of screening results
Dependencies
- pandas>=2.0.0
- numpy>=1.24.0
FAQ
What does the stock-screener skill do?
Filter and screen stocks by financial metrics like P/E ratio, market cap, dividend yield, and growth rates. Analyze and compare stocks from CSV data.
How do I install stock-screener?
Run npx skills add https://github.com/dkyazzentwatwa/chatgpt-skills --skill stock-screener in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/stock-screener/ (personal) or .claude/skills/stock-screener/ (project).
Which AI agents can use stock-screener?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is stock-screener safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains stock-screener?
It is published by dkyazzentwatwa in dkyazzentwatwa/chatgpt-skills. It has 183 recorded installs.
More from dkyazzentwatwa/chatgpt-skills
ocr-document-processor
dkyazzentwatwa/chatgpt-skills
Extract text and structure from scans, images, and scanned PDFs. Use for OCR, searchable PDFs, table extraction, receipt parsing, and business card parsing.
crypto-ta-analyzer
dkyazzentwatwa/chatgpt-skills
Run multi-indicator technical analysis on crypto or market OHLCV data. Use for deterministic trend, momentum, volume, and divergence analysis.
text-summarizer
dkyazzentwatwa/chatgpt-skills
Generate extractive summaries from long text documents. Control summary length, extract key sentences, and process multiple documents.
financial-calculator
dkyazzentwatwa/chatgpt-skills
Run loan, investment, NPV, retirement, savings, and risk calculations with schedules and charts. Use for deterministic financial modeling tasks.
document-converter-suite
dkyazzentwatwa/chatgpt-skills
Convert PDFs, Office docs, markdown, HTML, and tables between editable formats. Use for best-effort document conversion, PDF utilities, form filling, and table extraction.
image-enhancement-suite
dkyazzentwatwa/chatgpt-skills
Process images for cleanup, conversion, metadata, comparison, icons, palettes, collages, and sprite sheets. Use for single-image or batch image workflows.
Popular business & finance skills
sales-enablement
coreyhaines31/marketingskills
When the user wants to create sales collateral, pitch decks, one-pagers, objection handling docs, or demo scripts. Also use when the user mentions 'sales deck,' 'pitch deck,' 'one-pager,' 'leave-behind,' 'objection handling,' 'deal-specific ROI analysis,' 'demo script,' 'talk track,' 'sales playbook,' 'proposal template,' 'buyer persona card,' 'battle card,' 'battlecard,' 'competitive one-pager,' 'win-loss analysis,' 'why are we losing deals,' 'loss reasons,' 'how do I respond to this objection,' 'prospect just said,' 'help my sales team,' 'sales materials,' or 'what should I give my sales reps,' 'cold call script,' or 'voicemail script.' Use this for any document or asset that helps a sales team close deals. For public competitor comparison pages, see competitors. For running buyer interviews or churn research, see customer-research. For marketing website copy, see copywriting. For cold outreach emails, see cold-email. For the offer being sold (bonuses, guarantees, pricing structure),
revops
coreyhaines31/marketingskills
When the user wants help with revenue operations, lead lifecycle management, or marketing-to-sales handoff processes. Also use when the user mentions 'RevOps,' 'revenue operations,' 'lead scoring,' 'outbound pipeline stages,' 'lead routing,' 'MQL,' 'SQL,' 'pipeline stages,' 'deal desk,' 'CRM automation,' 'marketing-to-sales handoff,' 'data hygiene,' 'leads aren't getting to sales,' 'pipeline management,' 'lead qualification,' or 'when should marketing hand off to sales.' Use this for anything involving the systems and processes that connect marketing to revenue. For cold outreach emails, see cold-email. For email drip campaigns, see emails. For pricing decisions, see pricing.
sales-funnel-blueprint
autonnel/autonnel-skills
Turn an offer into a concrete multi-step sales funnel spec - page-by-page structure, price ladder, copy outline and the metrics each step must hit. Use when asked to build a sales funnel, marketing funnel, landing page flow, lead magnet funnel, webinar funnel, tripwire or VSL funnel, when planning a product launch page flow, or when someone asks "what pages do I need" for selling something online.
pricing
coreyhaines31/marketingskills
When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' 'should I offer a free plan,' 'pricing page teardown,' 'pricing page audit,' 'is my pricing page AI-readable,' or 'can AI read my pricing.' Use this whenever someone is figuring out what to charge, how to structure their plans, or wants to audit a pricing page (for humans and for the AI agents that shortlist tools). For in-app upgrade screens, see paywalls. For offer construction (bonuses, guarantees, value framing, naming) on services/courses/coaching/high-ticket B2B, see offers.
cross-border-ecommerce
nexscope-ai/ecommerce-skills
Cross-border e-commerce expansion advisor. Scores target markets on 8 weighted dimensions (market size, ecommerce penetration, competition, regulatory complexity, logistics infrastructure, payment ecosystem, cultural distance, IP protection), compares 5 fulfillment models with cost and transit data, provides country-by-country tax/duty compliance guides (EU VAT/IOSS, UK VAT, US sales tax, CA GST, AU GST, JP consumption tax), maps local payment preferences by market, and builds a phased expansion roadmap. No API key required.
pricing-strategy
coreyhaines31/marketingskills
When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' or 'should I offer a free plan.' Use this whenever someone is figuring out what to charge or how to structure their plans. For in-app upgrade screens, see paywall-upgrade-cro.