Skip to content

API Reference parrot_tools.quant.piotroski

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.quant.piotroski

View source

Piotroski F-Score Calculator for QuantToolkit.

The Piotroski F-Score is a fundamental quality scoring system that evaluates company financial health using 9 binary accounting criteria:

Profitability (4 points):

  1. Positive Net Income
  2. Positive ROA (Return on Assets)
  3. Positive Operating Cash Flow
  4. Cash Flow > Net Income (quality of earnings)

Leverage/Liquidity/Source of Funds (3 points): 5. Lower Long-Term Debt (YoY) 6. Higher Current Ratio (YoY) 7. No New Shares Issued

Operating Efficiency (2 points): 8. Higher Gross Margin (YoY) 9. Higher Asset Turnover (YoY)

Score Interpretation:

  • 8-9: Excellent (strong buy signal)
  • 6-7: Good (positive outlook)
  • 4-5: Fair (neutral)
  • 0-3: Poor (avoid or sell)

Alias PiotroskiInput

Re-exported from parrot_tools.quant.models.PiotroskiInput.

Function batch_piotroski_scores

Calculate F-Scores for multiple symbols.

batch_piotroski_scores(symbols_data: dict[str, PiotroskiInput]) -> dict[str, dict]

Parameter Type Default Description
symbols_data dict[str, PiotroskiInput] Dictionary of {symbol: PiotroskiInput}.

Returns: dict[str, dict] — Dictionary of {symbol: score_result}.

Function calculate_piotroski_score

Calculate Piotroski F-Score (0-9) for fundamental quality.

The F-Score measures financial strength using 9 binary criteria across three categories:

  • Profitability (4 points)
  • Leverage/Liquidity/Source of Funds (3 points)
  • Operating Efficiency (2 points)

calculate_piotroski_score(input_data: PiotroskiInput) -> dict

Parameter Type Default Description
input_data PiotroskiInput PiotroskiInput with quarterly and prior year financials.

Returns: dict — Dictionary with: - total_score: int (0-9) - criteria: dict with details for each criterion - data_completeness_pct: float (0-100) - interpretation: str (Excellent/Good/Fair/Poor) - category_scores: dict with profitability, leverage_liquidity, operating_efficiency

Function get_fscore_summary

Generate a human-readable summary of the F-Score result.

get_fscore_summary(result: dict) -> str

Parameter Type Default Description
result dict Result from calculate_piotroski_score.

Returns: str — Summary string.

Function rank_by_fscore

Rank symbols by F-Score descending.

rank_by_fscore(symbols_data: dict[str, PiotroskiInput]) -> list[tuple[str, int, str]]

Parameter Type Default Description
symbols_data dict[str, PiotroskiInput] Dictionary of {symbol: PiotroskiInput}.

Returns: list[tuple[str, int, str]] — List of (symbol, score, interpretation) tuples, sorted by score descending.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally