Skip to main content

Preflight banner

PyPI version PyPI downloads Code style: black


Dataset readiness checks for ML pipelines. Use preflight to catch data blockers before training and deployment.

Why preflight

  • Runs fast checks for data quality, target risk, schema/type issues, split integrity, and statistical anomalies.
  • Produces machine-readable findings and a CI gate decision (PASS/FAIL).
  • Keeps output stable with schema versioning for downstream tooling.

Quickstart

Install:

pip install preflight-data

Python API:

import pandas as pd
import preflight

df = pd.read_csv("data.csv")
report = preflight.run(df, target="churn", profile="ci-balanced")

print(report)

CLI:

preflight run data.csv --target churn --profile ci-balanced --format text

Example output:

Preflight Run Report
────────────────────────────────────────────────────────
Gate: PASS
Heuristic Score: 97.0/100
Profile: ci-balanced
Dataset: 1000/1000 rows analyzed across 6 columns
Target: churn
Summary: 8 info, 1 warn, 0 error, 0 critical

Gate reasons:
- No findings met fail conditions for this profile

Findings:
- [WARN] completeness.missingness: Overall missingness is 1.8% (108 cells missing across dataset). (confidence=0.95)
- [INFO] duplicates.exact: No exact duplicate rows detected. (confidence=0.95)
- [INFO] balance.class_imbalance: Class distribution is within configured tolerance. (confidence=0.90)

HTML report preview

If you want to see what the generated HTML report looks like, open:

The notebook contains rendered report.to_html() output cells.

Core model

  • finding: one detected issue or advisory signal
  • severity: info | warn | error | critical
  • gate: policy decision based on severities (PASS | FAIL)
  • score: heuristic summary for trend/comparison, not statistical truth

Score guidance:

  • Good for rough trend tracking across runs
  • Not a probability of model success

Common workflows

Dataset readiness (single table)

report = preflight.run(df, target="churn", profile="ci-balanced")

Split integrity (train/validation or train/test)

split_report = preflight.run_split(train_df, valid_df, profile="ci-balanced")

Policy profiles

Built-in profiles:

  • exploratory: permissive, useful in notebooks
  • ci-balanced: practical CI default
  • ci-strict: highest sensitivity for blocking conditions

Example:

preflight run data.csv --target churn --profile ci-strict --format json

--fail-on override:

preflight run data.csv --target churn --profile ci-balanced --fail-on error,critical

Policy argument rules:

  • Use either --profile or --policy-file (mutually exclusive).
  • --fail-on is only supported with --profile.
  • Invalid policy/config files fail fast at load time.

CLI reference

# Recommended policy-first commands
preflight run data.csv --target churn --profile ci-balanced --format json
preflight run-split train.csv test.csv --profile ci-balanced --format markdown

# Optional artifacts
preflight run data.csv --target churn --format text --output report.txt --output-html report.html

# Compare against baseline JSON report
preflight compare current.json baseline.json --max-score-drop 3 --fail-on-new-error

# Suppressions
preflight suppress add --file suppressions.json --check-id leakage.high_correlation --reason "known safe"
preflight suppress list --file suppressions.json
preflight suppress validate --file suppressions.json --fail-on-expired

HTML output

CLI:

preflight run data.csv --target churn --profile ci-balanced --format text --output-html report.html

Python:

report = preflight.run(df, target="churn", profile="ci-balanced")
html = report.to_html()
with open("report.html", "w", encoding="utf-8") as f:
    f.write(html)

This creates a shareable HTML report you can attach to CI artifacts, docs, or review tickets.

Exit codes:

  • 0: gate pass
  • 2: gate fail or explicit CLI validation failure

Output schema contract

RunReport.to_dict() includes stable contract keys:

  • schema_version
  • run
  • dataset
  • gate
  • score
  • summary
  • findings

Per-finding payload includes evidence and explainability fields:

  • check_id, title, domain, severity, suppressed
  • suggested_action, docs_url
  • evidence.metrics, evidence.threshold, evidence.samples

Examples

Legacy compatibility

Legacy check(...) and check_split(...) APIs are still available for compatibility, but run(...) and run_split(...) are recommended for policy-first workflows.

Migration status: the policy-first runner now uses native checks for class balance, completeness, leakage, duplicates, distributional health, correlations, and types. Legacy APIs remain supported during migration.

Compatibility namespace:

  • preflight.legacy.check(...)
  • preflight.legacy.check_split(...)
  • preflight.legacy.Report

Development

make env
conda activate preflight
make install-dev
make test
make lint
make typecheck
make build

Supported versions

  • Python: 3.9-3.13
  • pandas: >=1.3
  • numpy: >=1.21

License

Apache-2.0

Metadata

Release files for preflight-data 0.1.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 preflight-data 0.1.1
File Size Uploaded
preflight_data-0.1.1.tar.gz 74.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for preflight-data 0.1.1
File Interpreter ABI Platform
preflight_data-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 154.5 kB

Release files / preflight_data-0.1.1.tar.gz

Download URL preflight_data-0.1.1.tar.gz
Size 74.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b51183727dd377fa7dd4f11a8c7fef71ec769d7c23c9ea7ea2d2ac8edd082453
BLAKE2b-256 checksum
How to use checksums
25a949915387cb0cadb55960de77c2f2e176cd9d11cd93bf1c58e807bdb02eb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 28, 2026.

Transparency log

Release files / preflight_data-0.1.1-py3-none-any.whl

Download URL preflight_data-0.1.1-py3-none-any.whl
Size 79.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57e24d22b4a7fc7aeb85b81417fb14667ab556214df7db4399ff3a3777d198b2
BLAKE2b-256 checksum
How to use checksums
c6f851827e1d8d30c1ba07b187b08fcb1da2b16371dd10d401e41a736c9bd433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 Mar 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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