Skip to main content

Katsustats

License Python PyPI Downloads CI Ruff Sponsor

Polars-powered backtest analytics and reporting, inspired by quantstats.

Pass a DataFrame with date and returns — get 70+ metrics, 21 charts, and a self-contained HTML report.

HTML Report Preview

View a full BTC vs ETH backtest report

Quickstart

pip install katsustats yfinance
from katsustats import reports, utils

returns = utils.download_returns("AAPL")  # ["date", "returns"]
reports.html(returns, output="report.html")

Pandas, quantstats-style DatetimeIndex inputs, and price frames (via utils.to_returns) all work — see Data format. Runnable examples: examples/quickstart.py, examples/with_benchmark.py.

Install

pip install katsustats
Other install paths
uv add katsustats            # uv project
pipx install katsustats      # CLI-only use
uv tool install katsustats   # CLI-only via uv

Pre-built binaries (no Python needed) are on the Releases page:

chmod +x katsustats-linux-x86_64
./katsustats-linux-x86_64 report trades.csv -o report.html

Try it online: Google Colab · Kaggle

Features

  • Reports — self-contained offline HTML, agent-friendly JSON, readable Markdown (docs)
  • Benchmarks — Alpha, Beta, capture ratios, regime analysis with one argument
  • Monte Carlo — bootstrap/shuffle luck analysis with bust/goal probabilities (docs)
  • Snapshots — dark/light single-image performance cards for sharing (docs)
  • CLI + binary — CSV/Parquet to report with no script (docs)
  • 70+ metrics, 21 charts — functional stats / plots API (docs)
katsustats report trades.csv -o report.html
katsustats report trades.csv --format json -o report.json
katsustats snapshot trades.csv --window 3M --theme dark -o snapshot.png

katsustats vs quantstats

katsustats quantstats
Engine Polars-first (pandas accepted) pandas-only
No-script CLI / binary ✅ ❌
JSON + Markdown reports (agent-friendly) ✅ HTML only
Snapshot cards (dark/light) ✅ light only
Monte Carlo methods bootstrap + shuffle bootstrap
Rolling greeks, outlier/CPC/RAR metrics ✅ partial

Docs

Metadata

Release files for katsustats 0.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for katsustats 0.12.0
File Size Uploaded Provenance Actions
katsustats-0.12.0.tar.gz 868.5 kB With provenance Details for katsustats-0.12.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for katsustats 0.12.0
File Interpreter ABI Platform Actions
katsustats-0.12.0-py3-none-any.whl Python 3 none any Details for katsustats-0.12.0-py3-none-any.whl

Total release size: 919.2 kB

Release files / katsustats-0.12.0.tar.gz

Download URL katsustats-0.12.0.tar.gz
Size 868.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b2d16b771002e887b2e10cc92d694c912db8fe44fe084fd22a2e62aa15b6f10f
BLAKE2b-256 checksum
How to use checksums
a8d6450ef1961ef3b247a9fb5b87b97da6ad929bf67b056836a500fcae52f5f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / katsustats-0.12.0-py3-none-any.whl

Download URL katsustats-0.12.0-py3-none-any.whl
Size 50.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f5d09eaf07b7a045be865001d0d6957fe84d14b2b3939f8a3db5a43e9091317
BLAKE2b-256 checksum
How to use checksums
3852481a7602791e47317fa4ebdbe4a30467ec05eb4d15706fd4bb91220a9871
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Security for katsustats 0.12.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for katsustats-0.12.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page