4.5k stars · MIT · v0.33.1 (2026-09-01) · Track this in Scout
Schema validation for DataFrames — the error that fires before a backtest quietly reports a fictional edge.
▶Repo detailsthe review · specs · pros & cons · install
What it is
Schema checking for data tables. You declare what the columns are, what values they may hold, what must never be empty, and what must be unique. It raises an error the moment the data disagrees.
What it is good for. A strategy search is built on exactly that: search. tsfresh makes features, Optuna hunts, arch tests whether the winner was luck. Every one of those steps assumes that three years of price bars really are three years of price bars. When that assumption breaks, nothing crashes. The numbers just become wrong. A wrong number that survives a reality check is the most expensive thing in such a system. The same argument applies to what comes out of Docling and Chonkie in a document pipeline.
- MIT licence and plain Python, so it fits inside FastAPI and inside a background job with no fuss.
- Works with pandas and Polars, so it survives whichever you switch to.
- The schema also works as documentation that cannot go out of date, because it fails when it is wrong.
- It checks shape and range, not truth. A believable but wrong price passes every check.
- Writing the schemas is real work up front, with nothing visible to show on the day you do it.
- Checking large tables takes time. Run it when loading data, never inside the fast path. Needs Python 3.10 or newer.
source venv/bin/activate pip install "pandera[pandas]"

