import pointblank as pb
small_table = pb.load_dataset("small_table")
pb.preview(small_table)PolarsRows13Columns8 |
||||||||
Data Validation Everyone Can Read
Contributing guide
Code of conduct
Project roadmap
Security policy
Full license MIT
Citing pointblank
Requires: Python >=3.10
Provides-Extra: pd, pl, pyspark, generate, mcp, otel, excel, cdisc, ml, cdisc-core, bigquery, databricks, duckdb, mysql, mssql, postgres, snowflake, sqlite, docs
Package Info
Pointblank checks your tables for the problems that matter (missing values, out-of-range numbers, malformed text, duplicate rows) and reports what it finds in tables that analysts, engineers, and stakeholders can all read.
A validation is a table, a plan of checks, and a report. Step through this one to see what each part adds, with the new lines of code highlighted.
Data
Start with a table: Polars, Pandas, a DuckDB or Spark table, a database table, or a CSV or Parquet file. pb.preview() shows its first and last rows and its column types.
PolarsRows13Columns8 |
||||||||
date_time Datetime |
date Date |
a Int64 |
b String |
c Int64 |
d Float64 |
e Boolean |
f String |
|
|---|---|---|---|---|---|---|---|---|
| 1 | 2016-01-04 11:00:00 | 2016-01-04 | 2 | 1-bcd-345 | 3 | 3423.29 | True | high |
| 2 | 2016-01-04 00:32:00 | 2016-01-04 | 3 | 5-egh-163 | 8 | 9999.99 | True | low |
| 3 | 2016-01-05 13:32:00 | 2016-01-05 | 6 | 8-kdg-938 | 3 | 2343.23 | True | high |
| 4 | 2016-01-06 17:23:00 | 2016-01-06 | 2 | 5-jdo-903 | None | 3892.4 | False | mid |
| 5 | 2016-01-09 12:36:00 | 2016-01-09 | 8 | 3-ldm-038 | 7 | 283.94 | True | low |
| 9 | 2016-01-20 04:30:00 | 2016-01-20 | 3 | 5-bce-642 | 9 | 837.93 | False | high |
| 10 | 2016-01-20 04:30:00 | 2016-01-20 | 3 | 5-bce-642 | 9 | 837.93 | False | high |
| 11 | 2016-01-26 20:07:00 | 2016-01-26 | 4 | 2-dmx-010 | 7 | 833.98 | True | low |
| 12 | 2016-01-28 02:51:00 | 2016-01-28 | 2 | 7-dmx-010 | 8 | 108.34 | False | low |
| 13 | 2016-01-30 11:23:00 | 2016-01-30 | 1 | 3-dka-303 | None | 2230.09 | True | high |
Plan
Say what good data looks like, one check per step. There are checks for values, text patterns, sets, missing values, duplicates, row counts, schemas, and more. Before the checks are run, the report shows the plan.
(
pb.Validate(
data=small_table,
tbl_name="small_table",
label="Checks on the sales data",
)
.col_vals_gt(columns="d", value=1000)
.col_vals_not_null(columns="c")
.col_vals_regex(columns="b", pattern=r"^\d-[a-z]{3}-\d{3}$")
.col_vals_in_set(columns="f", set=["low", "mid", "high"])
.rows_distinct()
)Pointblank ValidationNo Interrogation Performed |
|||||||||||||
Checks on the sales data Polarssmall_table |
|||||||||||||
| STEP | COLUMNS | VALUES | TBL | EVAL | UNITS | PASS | FAIL | W | E | C | EXT | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| #4CA64C66 | 1 |
col_vals_gt()
|
d | 1000 | — | ||||||||
| #4CA64C66 | 2 |
col_vals_not_null()
|
c | — | — | ||||||||
| #4CA64C66 | 3 |
col_vals_regex()
|
b | ^\d-[a-z]{3}-\d{3}$ | — | ||||||||
| #4CA64C66 | 4 |
col_vals_in_set()
|
f | low, mid, high | — | ||||||||
| #4CA64C66 | 5 |
rows_distinct()
|
ALL COLUMNS | — | — | ||||||||
Thresholds
Decide how much failure is too much. Thresholds set the share of failing rows that counts as a warning, an error, or a critical problem, and actions can run when one is reached.
(
pb.Validate(
data=small_table,
tbl_name="small_table",
label="Checks on the sales data",
thresholds=pb.Thresholds(warning=0.05, error=0.10, critical=0.15),
)
.col_vals_gt(columns="d", value=1000)
.col_vals_not_null(columns="c")
.col_vals_regex(columns="b", pattern=r"^\d-[a-z]{3}-\d{3}$")
.col_vals_in_set(columns="f", set=["low", "mid", "high"])
.rows_distinct()
)Pointblank ValidationNo Interrogation Performed |
|||||||||||||
Checks on the sales data Polarssmall_tableWARNING0.05ERROR0.1CRITICAL0.15 |
|||||||||||||
| STEP | COLUMNS | VALUES | TBL | EVAL | UNITS | PASS | FAIL | W | E | C | EXT | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| #4CA64C66 | 1 |
col_vals_gt()
|
d | 1000 | — | ||||||||
| #4CA64C66 | 2 |
col_vals_not_null()
|
c | — | — | ||||||||
| #4CA64C66 | 3 |
col_vals_regex()
|
b | ^\d-[a-z]{3}-\d{3}$ | — | ||||||||
| #4CA64C66 | 4 |
col_vals_in_set()
|
f | low, mid, high | — | ||||||||
| #4CA64C66 | 5 |
rows_distinct()
|
ALL COLUMNS | — | — | ||||||||
Report
Run the checks with interrogate(). The report shows every step: how many rows passed and failed, which thresholds were reached, and a CSV of the failing rows. With brief=True, each step also says in plain words what it checks.
(
pb.Validate(
data=small_table,
tbl_name="small_table",
label="Checks on the sales data",
brief=True,
thresholds=pb.Thresholds(warning=0.05, error=0.10, critical=0.15),
)
.col_vals_gt(columns="d", value=1000)
.col_vals_not_null(columns="c")
.col_vals_regex(columns="b", pattern=r"^\d-[a-z]{3}-\d{3}$")
.col_vals_in_set(columns="f", set=["low", "mid", "high"])
.rows_distinct()
.interrogate()
)A failing step is a starting point, not a dead end. Open any step in a report of its own, pull out the rows that failed, or split the table into its passing and failing rows.
A step’s own report
The rows where c is missing, with the failing values highlighted.
| Report for Validation Step 2 ✗ ASSERTION 2 / 13 TEST UNIT FAILURES IN COLUMN 5 EXTRACT OF ALL 2 ROWS (WITH TEST UNIT FAILURES IN RED): |
||||||||
date_time Datetime |
date Date |
a Int64 |
b String |
c Int64 |
d Float64 |
e Boolean |
f String |
|
|---|---|---|---|---|---|---|---|---|
| 4 | 2016-01-06 17:23:00 | 2016-01-06 | 2 | 5-jdo-903 | None | 3892.4 | False | mid |
| 13 | 2016-01-30 11:23:00 | 2016-01-30 | 1 | 3-dka-303 | None | 2230.09 | True | high |
The failing rows
The rows where d isn’t over 1,000, as a table of their own.
PolarsRows6Columns9 |
||||||||
date_time Datetime |
date Date |
a Int64 |
b String |
c Int64 |
d Float64 |
e Boolean |
f String |
|
|---|---|---|---|---|---|---|---|---|
| 5 | 2016-01-09 12:36:00 | 2016-01-09 | 8 | 3-ldm-038 | 7 | 283.94 | True | low |
| 7 | 2016-01-15 18:46:00 | 2016-01-15 | 7 | 1-knw-093 | 3 | 843.34 | True | high |
| 9 | 2016-01-20 04:30:00 | 2016-01-20 | 3 | 5-bce-642 | 9 | 837.93 | False | high |
| 10 | 2016-01-20 04:30:00 | 2016-01-20 | 3 | 5-bce-642 | 9 | 837.93 | False | high |
| 11 | 2016-01-26 20:07:00 | 2016-01-26 | 4 | 2-dmx-010 | 7 | 833.98 | True | low |
| 12 | 2016-01-28 02:51:00 | 2016-01-28 | 2 | 7-dmx-010 | 8 | 108.34 | False | low |
Split the table
Every row that failed any step, ready for a quarantine table.
PolarsRows8Columns8 |
||||||||
date_time Datetime |
date Date |
a Int64 |
b String |
c Int64 |
d Float64 |
e Boolean |
f String |
|
|---|---|---|---|---|---|---|---|---|
| 1 | 2016-01-06 17:23:00 | 2016-01-06 | 2 | 5-jdo-903 | None | 3892.4 | False | mid |
| 2 | 2016-01-09 12:36:00 | 2016-01-09 | 8 | 3-ldm-038 | 7 | 283.94 | True | low |
| 3 | 2016-01-15 18:46:00 | 2016-01-15 | 7 | 1-knw-093 | 3 | 843.34 | True | high |
| 4 | 2016-01-20 04:30:00 | 2016-01-20 | 3 | 5-bce-642 | 9 | 837.93 | False | high |
| 5 | 2016-01-20 04:30:00 | 2016-01-20 | 3 | 5-bce-642 | 9 | 837.93 | False | high |
| 6 | 2016-01-26 20:07:00 | 2016-01-26 | 4 | 2-dmx-010 | 7 | 833.98 | True | low |
| 7 | 2016-01-28 02:51:00 | 2016-01-28 | 2 | 7-dmx-010 | 8 | 108.34 | False | low |
| 8 | 2016-01-30 11:23:00 | 2016-01-30 | 1 | 3-dka-303 | None | 2230.09 | True | high |
Pointblank works through Narwhals and Ibis, so the same plan runs unchanged on DataFrames and in databases, and the checks happen where the data is.
Polars Pandas PyArrow DuckDB PySpark Snowflake BigQuery Databricks PostgreSQL MySQL SQL Server SQLite CSV and Parquet
Validation is the core, and everything else builds on it.
Reusable data contracts, checked where data comes in and where it goes out. Import JSON Schema and Frictionless.
Keep plans in YAML for review, and run them with pb in CI, with exit codes and extracts.
Get a first plan from a model that looked at your table, then revise it in plain English.
Find the rows and values that differ between two tables, even across backends and large files.
Check training splits, synthetic data, and text, then measure which failing rows hurt a model.
Previews, column summaries, and missing-value maps to see what a table holds.
Generate realistic data from a schema, in 100+ locales, as a pytest fixture.
CDISC SDTM and ADaM, Define-XML, and metadata from SPSS, SAS, and Stata files.
An MCP server and Agent Skills for AI assistants, and OpenTelemetry traces and metrics.
Install Pointblank from PyPI:
Then make your first validation in the Quickstart, or look through the Demos for ideas. Reports come in 40 languages.