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 GitHub Marketplace

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

Start with datasets-lint init train.jsonl, then review the inferred columns and percentage thresholds. Existing configs require --force to overwrite. See configuration for the sampling and margin rules.

[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 & Marketplace

The Action is listed on the GitHub Marketplace (categories: code-quality, testing).

- uses: horizonbymuneeb/datasets-lint@v1.1.0
  with:
    paths: data/train.jsonl data/test.jsonl
    fail-on: error
- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: datasets-lint.sarif
- uses: horizonbymuneeb/datasets-lint@v1.1.0
  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.2.1

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.2.1
File Size Uploaded Provenance Actions
datasets_lint-1.2.1.tar.gz 2.8 MB With provenance Details for datasets_lint-1.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 5.1 MB

Release files / datasets_lint-1.2.1.tar.gz

Download URL datasets_lint-1.2.1.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
cd846e16a7b748bf2abd76229ae2f89764424b161013fa99194032753143f41a
BLAKE2b-256 checksum
How to use checksums
609c7570153ce85553a1b9c5bc01747bf99c67493fd9b228aa3b8a73591390ae
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.2.1-py3-none-any.whl

Download URL datasets_lint-1.2.1-py3-none-any.whl
Size 2.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b8d8ad45d4003899ec299402fc66f5d7f38665f037ecd9d9570fead4f18b948b
BLAKE2b-256 checksum
How to use checksums
b1b08a4e4cd6a9f69aed09a7d21ba9e6d62c1b9eb68771f3779f85def927e4e5
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.2.1

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.2.1.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