Skip to main content

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.

PyPI CI License: MIT

datasets-lint HTML report

$ 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 / MMLU 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.

Contributing

New checks are the best way to contribute: one file, one fixture, one test. See CONTRIBUTING.md and the good first issue list.

License

MIT. Bundled eval data: GSM8K, HumanEval and MMLU, all MIT — see src/datasets_lint/data/eval/manifest.json for sources and checksums.

Metadata

Release files for datasets-lint 1.1.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 datasets-lint 1.1.0
File Size Uploaded Provenance Actions
datasets_lint-1.1.0.tar.gz 2.7 MB With provenance Details for datasets_lint-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datasets-lint 1.1.0
File Interpreter ABI Platform Actions
datasets_lint-1.1.0-py3-none-any.whl Python 3 none any Details for datasets_lint-1.1.0-py3-none-any.whl

Total release size: 5.0 MB

Release files / datasets_lint-1.1.0.tar.gz

Download URL datasets_lint-1.1.0.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
555ada2c97fd19ab2490bfc2f3bb2e18c56d7791ac78b2a61de3042633fb485f
BLAKE2b-256 checksum
How to use checksums
196d3f23cefa9ab4d41c68bfb8c98a269a31f0bc8a491d5f8cdffe0c32234353
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 log

Release files / datasets_lint-1.1.0-py3-none-any.whl

Download URL datasets_lint-1.1.0-py3-none-any.whl
Size 2.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7f4bbe68c561c70d109098412276f557ddadeb353aa83b5b227882c9a6c26d73
BLAKE2b-256 checksum
How to use checksums
03c8e99b982e59881e387a99777e1c893fc6a5f1fae082839418c0f501a4efbd
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 log

Security for datasets-lint 1.1.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 datasets_lint-1.1.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 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