AndreaBozzo/dataprof
关于
Data profiling and quality gates for CSV, JSON, Parquet and DataFrames. Rust core, Python API.
开发工具可以做什么
- Same data, same numbers. Serialized reports from Rust and Python agree across input routes and engines, within the numeric contract. Sampled values say so: is_approximate, unique_count_is_approximate, quality_sampled_dimensions.
- Bounded memory. Files larger than RAM stream through fixed-size accumulators. Duplicate rows are counted exactly up to 1,000,000 distinct rows by default, and estimated beyond that or under memory pressure.
- Honest verdicts. A sampled or partial scan passes a claim about the whole file only when what it read already proves it; otherwise the check is inconclusive. A sampled score carries an interval in score_bounds when it can be bounded.
- Absence is not zero. A metric that wasn't computed is None, never a plausible default.
实测星标增长
- 24小时
- -1
- 7天
- -1
- 15天
- 0
- 1个月
- +1
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
dataprof
Know what's in your data before it ships.
Website · Getting started · Python API · Rust guide · Release notes
dataprof profiles CSV, JSON, JSONL, Parquet, DataFrames and Arrow tables in one call: types, nulls, distributions, patterns, and quality dimensions that name the columns behind them. Then it gates your pipeline on what it found, including changes from a saved baseline. A Rust library with a Python package on top; local profiling needs no server, account or network access.
Install
pip install dataprof # or: uv pip install dataprof
Wheels for CPython 3.11 to 3.15 on Linux, macOS and Windows, with no Python dependencies. pandas and polars inputs need pyarrow; databases need a source build. See input routes.
Profile a file
import dataprof as dp
report = dp.profile("orders.csv") # also .json, .jsonl, .parquet, DataFrames, dicts
print(report.rows, "rows,", report.columns, "columns")
amount = report["amount"]
print(amount.data_type, amount.mean, amount.null_percentage)
Ask it what deserves attention. Each finding has a stable code and the evidence behind it, never a raw value:
for finding in report.findings():
print(finding.severity, finding.code, finding.column)
# warning locale_numbers price ("10,50"-style numbers, left out of the stats)
# warning null_heavy email
# info sensitive_pattern email
Ask which columns cost each quality dimension its points:
print(report.explain())
# completeness: 93.3
# - customer_id, 40 of 200 null cells
Gate a pipeline
State what "good enough" means and get a verdict: pass, fail, or inconclusive when the data can't prove it either way.
result = report.check(max_null_count={"customer_id": 0}, max_null_percentage={"*": 20})
print(result) # the verdict, then each failed or unevaluated check
if result.verdict != "pass":
raise SystemExit(f"quality gate: {result.verdict}")
Gate on rules that name a column. The overall score is an average over columns and dimensions: in a three-column file of 200 rows, 40 empty customer_id cells still score 97.2, so min_quality_score=90 passes it while max_null_count fails it.
Other checks cover column types (column_types), value bounds (min_value, max_value), freshness (max_date_age, max_date_gap), volume (min_rows, max_row_count_drop), keys (unique_columns) and schema drift (forbid_removed_columns). See the cookbook.
Or from CI, with no code at all:
python -m dataprof.check orders.csv --max-null-count "customer_id=0" --max-null "*=20"
# exit 0 = pass, 1 = fail, 2 = inconclusive, 3 = an argument, policy, input, baseline or output error
# Or against the last accepted run: fail if rows fall by more than 10%,
# a column's nulls rise by more than 5 points, or a column disappears.
python -m dataprof.check orders.csv --baseline accepted.json --allow-missing-baseline \
--max-row-drop 10 --max-null-increase "*=5" --forbid-removed-columns --promote accepted.json
--promote writes the baseline only on a pass, and --allow-missing-baseline lets the first run go without one. See the checkpoint recipe. In GitHub Actions, use dataprof-action: uses: AndreaBozzo/dataprof-action@v2.
Hand it to an agent
A token-bounded summary for an LLM. Values that look like personal data are never echoed:
print(report.to_llm_context(max_tokens=500))
Use it from Rust
cargo add dataprof
Use Rust 1.96 or later. The Rust guide shows how to profile a file, check the columns your pipeline relies on, and choose features for readers, Arrow batches, and database queries.
What you can count on
- Same data, same numbers. Serialized reports from Rust and Python agree across input routes and engines, within the numeric contract. Sampled values say so:
is_approximate,unique_count_is_approximate,quality_sampled_dimensions. - Bounded memory. Files larger than RAM stream through fixed-size accumulators. Duplicate rows are counted exactly up to 1,000,000 distinct rows by default, and estimated beyond that or under memory pressure.
- Honest verdicts. A sampled or partial scan passes a claim about the whole file only when what it read already proves it; otherwise the check is inconclusive. A sampled score carries an interval in
score_boundswhen it can be bounded. - Absence is not zero. A metric that wasn't computed is
None, never a plausible default. - Local by default. Reports carry statistics such as minima, maxima and modes;
to_llm_context()leaves raw values out by default.
Status
Beta, moving toward a stable 1.0 contract. Known narrow spots: numbers with a decimal comma are flagged but not parsed, and only empty, null, nan and a fixed set of markers such as NA, N/A and \N count as null, so - or -999 is still a value. The release notes list what changed.
Found something wrong? Open an issue. A file that profiles badly is the most useful bug report there is.
Learn more
- Why dataprof?: how it compares with summaries, visual reports and validation tools
- Getting started: the metrics and how to read them
- Profile a query result with Arrow and a saved baseline
- Python API: every function, the gate and the CI entrypoint
- Rust guide for profiling inputs, reports, and quality policies
- Examples: runnable recipes, from a messy CSV to a checkpoint against the last accepted run
- Agent workflows: AGENTS.md, Cursor rules and Claude Code skills
- Report schema: the saved document and its guarantees
- Database connectors and feature flags: Rust-side options
- Changelog and contributing
Citing dataprof
Use Cite this repository in the GitHub sidebar, which builds APA and BibTeX from CITATION.cff. The citation is for the software; benchmark material lives in scalcom2026-dataprof.
License
Either the MIT License or the Apache License, Version 2.0, at your option.
探索相关项目
加载中…