datasets-lint
ruff for training data. Audit a dataset for duplicates, PII, distribution problems, label conflicts, schema violations and eval-set contamination — then fix it — offline, on CPU, in one command, with CI-friendly exit codes.
$ uvx datasets-lint run train.jsonl --report out.html
✓ stats 120,000 rows · 0.00% empty · worst column 0.0% null
✗ dup 18.20% near-duplicate (4,211 clusters), 12.00% exact
✗ pii 0.41% of rows contain PII (email 487, phone 12, api_key 1)
✗ contamination 3.10% of rows overlap an eval set (gsm8k 3.10%)
✓ schema schema ok (2 columns)
✓ leakage no label conflicts
verdict: error — 3 errors, 0 warnings, 3 ok · 13.43s
report → out.html
Install
uvx datasets-lint --help # run without installing
pip install datasets-lint
The 30-second tour
datasets-lint run data.jsonl # audit
datasets-lint run data.jsonl --fix data.clean.jsonl # codemod: dedupe, drop empties, redact PII
datasets-lint run data.jsonl --profile strict --report out.html
datasets-lint run data.jsonl --sarif out.sarif # GitHub code scanning
datasets-lint run data.jsonl --baseline main.json # did this PR make it worse?
datasets-lint checks # list checks
Exit codes: 0 ok · 1 threshold breached · 2 usage error.
Checks
| id | what it finds | default failure |
|---|---|---|
stats |
empty rows, nulls, length percentiles, label balance | >1% empty |
dup |
exact + near duplicates (MinHash/LSH, exact Jaccard verified), cross-file overlap | >2% near-dup |
pii |
emails, phones, IPs, IBANs, SSNs, API keys — redacted in reports | any secret |
contamination |
overlap with GSM8K / HumanEval or your own eval sets | >1% overlap |
schema |
required columns, declared types, cardinality limits | missing column |
leakage |
identical texts with different labels (label noise) | >1% of rows |
Full reference: docs/checks.md.
Codemods (--fix)
Every repair is planned first, counted, and written to a new file — the input is never touched.
$ datasets-lint run train.jsonl --fix train.clean.jsonl
fixes: 327 rows dropped (dup 326 · stats 1) · 26 redactions (email 13 · phone 13)
fixed → train.clean.jsonl
| flag | meaning |
|---|---|
--fix OUT |
write the repaired dataset (.jsonl / .json / .csv / .parquet) |
--fix-only dup,pii |
run a subset of fixers |
--fix-keep first|last |
which row of a duplicate cluster to keep |
--fix-pii redact|drop |
redact in place (default) or drop the rows |
--fix-drop-contaminated |
also drop eval-set leaks (opt-in) |
--dry-run |
plan and report, write nothing |
Details and recipes: docs/codemods.md.
Profiles, suppressions, config
[defaults]
profile = "strict" # default | strict | ci | dev
sample = 100000
seed = 0
fail_on = "error"
[checks.dup]
max_near_dup_pct = 2.0
[[suppress]] # auditable, expiring exceptions
check = "pii"
rows = [12, 13]
reason = "public support addresses, DATA-118"
expires = "2027-01-01"
Full reference: docs/configuration.md.
CI
- uses: horizonbymuneeb/datasets-lint@v1
with:
paths: data/train.jsonl data/test.jsonl
fail-on: error
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: datasets-lint.sarif
Pre-commit, Docker, baseline diffs: docs/integrations.md.
Programmatic API
from datasets_lint import audit, fix, Config
report = audit("train.jsonl", config=Config(profile="strict"))
print(report.worst.value) # "ok" | "warn" | "error"
stats = fix("train.jsonl", "train.clean.jsonl", only=["dup", "pii"])
print(stats["dropped_by_fixer"], stats["redactions"])
Plugins
Third-party checks are normal packages with an entry point — no fork, no vendoring. See docs/plugins.md.
Numbers
Measured on 4 vCPU / 8 GB, no GPU (a laptop-class cloud VM):
| workload | wall | peak RSS |
|---|---|---|
| 100k rows, 54 MB JSONL, all checks | 46 s | 1.4 GB |
same, --fix included |
48 s | 1.5 GB |
contamination alone, 100k rows |
4.5 s | — |
Deterministic: same file + config + seed ⇒ identical JSON report.
License
MIT. Bundled eval data: GSM8K and HumanEval, both MIT — see
src/datasets_lint/data/eval/manifest.json for sources and checksums.
Metadata
Release files for datasets-lint 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| datasets_lint-1.0.0.tar.gz | 746.0 kB | With provenance | Details for datasets_lint-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datasets_lint-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for datasets_lint-1.0.0-py3-none-any.whl |
Total release size: 1.1 MB
Release files / datasets_lint-1.0.0.tar.gz
| Download URL | datasets_lint-1.0.0.tar.gz |
|---|---|
| Size | 746.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5a84a56c6a9bba3c6584c41810192d9a12c956a01e6a29be7320140c95e5712
|
|
BLAKE2b-256 checksum How to use checksums |
e49121ddd8b008869a335fbd330925be0411b6ec403b3f0c4e9678c09e5b8701
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 31, 2026.
Transparency logRelease files / datasets_lint-1.0.0-py3-none-any.whl
| Download URL | datasets_lint-1.0.0-py3-none-any.whl |
|---|---|
| Size | 313.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
374e231f16b40a7947851d0aded93491bd0f0f5dd0df5cac94ae39a7aa57b2d3
|
|
BLAKE2b-256 checksum How to use checksums |
be755b185996f4b3bb492f480231d86f7d415b65e4d98e080da56ca81a8a24e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 31, 2026.
Transparency logSecurity for datasets-lint 1.0.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.
Attestation for datasets_lint-1.0.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 Oct 31, 2026.
Transparency logA 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.