Skip to content

Releases

v2.12.0 — Validation rules and statistical drift

Choose a tag to compare

@devlprkhan devlprkhan released this 23 Nov 11:41
e31a07f

2.12.0 is the validation and statistical-drift release. It adds a composable rule layer on top of the existing validation report, reference-versus-current drift comparison, bounded failing-row diagnostics, and an append-only report sink for batch history.

Added

  • Statistical drift: DriftPolicy, DriftProfile, DistributionDriftReport, and compare_distributions() compare a current batch against a stored reference using population stability index (PSI), an approximate 1-D Wasserstein distance plus a scale-free ratio, missingness deltas, and category share deltas. Levels outside the retained reference categories are aggregated into an other bucket. Numeric and datetime columns are supported; booleans compare as categorical.
  • Documented thresholds: PSI 0.10 warning / 0.25 error, 5 pp missingness warning, 10 pp category warning, an optional Wasserstein ratio threshold, and min_sample=20, which downgrades errors to warnings on small batches. Thresholds must be finite and non-negative, counts must be integers, and policies serialize to and from JSON.
  • Portable profiles: DriftProfile.from_frame() keeps a bounded, JSON-serializable summary (bin edges, shares, scales, 512 midpoint quantiles per numeric column, and the top 20 levels per categorical column) instead of a sorted raw column. to_json() / from_json() round-trip the profile and its policy, and the default repr is redacted.
  • Composable rules: col() conditions with explicit .eq, .ne, .lt, .le, .gt, .ge, .isin, .not_in, .between, .isna, .notna, and .matches methods; &, |, and ~ composition; row_rule() for cross-column predicates; conditional() for scoped rules; grouped() for per-group checks; unique_combination(); and sum_equals(). Comparisons skip missing operands, so nulls do not fail a predicate unless it asks for them with .isna().
  • Public Validatable protocol: validate() accepts expectations, rules, custom objects with name, column, severity, and check(frame), and mixed lists. A custom rule may return several ValidationResult objects from one check.
  • Bounded diagnostics: ValidationReport.diagnose(frame, limit=5, include_values=False, include_index=True, max_value_length=32) samples failing rows as RowDiagnostics — bounded per failing rule, value-free by default, truncated values when enabled, and only failing frame-level or grouped rules listed in skipped.
  • Batch history: JsonlReportSink appends CleanerReport, DistributionDriftReport, or mapping records to a JSON Lines file, reads them back in order, summarizes history, and exposes drift_against_previous(), which reuses the stored reference profile and policy for a reproducible comparison.

Changed

  • ValidationReport gains sources and from_results(..., sources=...) so diagnostics can attribute failures. Reports built from contract findings have no sources and produce an empty diagnostic sample.
  • JSON-safe conversion is shared by reporting, drift, and sinks; drift profiles and reports serialize NaN and infinity as null and leak no non-standard JSON literals.
  • DriftProfile requires a non-empty reference and current frame with unique string column labels, reports missing or kind-changed columns as errors with metrics skipped, and never mutates the caller's frames.
  • sum_equals() fails rows with present non-numeric components or targets instead of silently skipping them, and JsonlReportSink reads records with split("\n") so Unicode line separators in metadata cannot corrupt history.

Integration boundary

This release integrates with Pandera, Feature-engine, and Evidently rather than rebuilding them: rules and drift operate on plain pandas frames, so existing contract and monitoring stacks can keep their own semantics.

Documentation

Compatibility

Python 3.10–3.13, pandas 2.x and 3.x. No new runtime dependencies.

Full changelog: https://github.com/devlprkhan/universal-data-cleaner/blob/main/CHANGELOG.md

v2.11.0 — Large data and performance

Choose a tag to compare

@devlprkhan devlprkhan released this 12 Nov 20:08
392b1f8

Phase 2 of the roadmap: scale behavior is now measured, reproduced, and
documented before any claim is made about it.

Install

pip install universal-data-cleaner==2.11.0
# Parquet support
pip install "universal-data-cleaner[parquet]==2.11.0"

Benchmark suite

benchmarks/run_benchmarks.py measures seven operations separately (ingest, fit,
transform, transform_with_report, transform_chunks, contract_check, validate)
across narrow, wide, and high-cardinality frames — 42 cases up to 2M rows.

  • Each case runs in a fresh subprocess; runtime (perf_counter, min of repeats,
    no tracing) and peak memory (tracemalloc after gc.collect()) are measured in
    separate phases.
  • Workloads are seeded and vectorized, so runs are reproducible.
  • The JSON records library/Python/pandas/NumPy/scikit-learn versions, platform,
    CPU count, and git commit, and is checkpointed after every case.
  • CI now runs a 10K-row smoke matrix, required by ci-success.

Reference run: benchmarks/results/2.11.0-darwin-x86_64.json
(Python 3.13.5 x86_64, pandas 3.0.6, NumPy 2.5.4, scikit-learn 1.9.1, 16 logical CPUs).

New API

  • DataCleaner.transform_chunks(chunks) yields (cleaned, DriftReport) per chunk
    without touching shared instance state, keeping one chunk in memory.
  • combine_drift_reports(reports) rolls chunk reports into a TransformReport
    with summed rows, chunk count, and concatenated findings, exposing the same
    has_drift / errors / warnings / summary() / raise_if_errors() surface
    as DriftReport.
  • DriftReport.rows records the batch size.
  • read_parquet_safe() and iter_parquet_safe() add optional Parquet ingestion
    (new parquet extra, pyarrow>=14) with the same contract audit, cross-batch
    uniqueness tracking, and report aggregation as the CSV readers.

Changed

  • transform() no longer deep-copies its input and skips redundant column
    selection and reindexing when the frame already matches the fitted schema. The
    no-mutation guarantee is unchanged and covered by tests.
  • docs/performance.md documents the methodology, the full measured matrix, the
    sizing rule derived from it, and an explicit "what is not measured" section.

Measured highlights

Workload Result
Fit + transform, 2M rows × 10 columns 7.7 s + 2.3 s, 620 MB traced peak
Fit + transform, 100K rows × 120 columns 2.5 s + 1.1 s, 241 MB traced peak
Contract check + validate, 2M rows 0.22 s + 0.06 s
Ingest 20M cells (2M × 10 CSV) 123 s, 725 MB traced peak
Chunked transform, 8 chunks, 2M rows same runtime, 5.8× lower traced peak

Ingestion is cell-bound at ~150K cells/s and is the operation that decides whether
a single-batch workflow fits; transform holds 8.6–11M cells/s.

Verification

All CI jobs passed on PR #45: lint, typecheck, tests on Python 3.10–3.13, compat
(minimum / latest / pandas 3), build, installed wheel, docs, benchmark smoke, and
ci-success. Provenance verification for this release is recorded in the follow-up
documentation commit.

v2.10.0 — Production correctness

Choose a tag to compare

@devlprkhan devlprkhan released this 12 Nov 16:39
a0759d6

Universal Data Cleaner 2.10.0

Production-correctness release. No new data-cleaning primitive; this version hardens the existing surface.

Concurrency-safe reporting

  • DataCleaner.transform_with_report(X) returns (cleaned_frame, DriftReport) for one batch without reading or writing shared state.
  • transform() stays backward compatible and documents drift_report_ as per-instance last-call state.

Numeric precision

  • CleanerConfig.preserve_integer_dtypes=True keeps integral columns as int64 when the learned fill value and outlier bounds are integral.
  • CleanerConfig.on_precision_loss supports "coerce", "warn", and "raise".
  • Detection is exact at the 2^53 boundary: representable values such as 2^53 + 2 stay intact, while 2^53 + 1 is flagged.

Artifact persistence

  • save() writes to a temporary file, validates it, then atomically replaces the target with os.replace. Failed saves keep the previous artifact and remove partial files.
  • load(..., strict_environment=True) turns pandas, NumPy, or scikit-learn major-version mismatches into ArtifactCompatibilityError; the default logs a warning.
  • Corrupt and truncated artifacts now raise ValueError with the underlying cause.

Chunked ingestion

  • iter_csv_safe() gains unique_tracking ("memory", "disk", or "auto"), unique_tracking_limit, and unique_tracking_path.
  • Disk tracking uses SQLite; "auto" migrates from memory once the limit is exceeded.
  • combine_ingestion_reports(reports, source=None) rolls per-chunk reports into one whole-file report.

Documentation

  • Updated cleaning, ingestion, production, artifact, API, README, changelog, and roadmap documentation.

Verification

  • Local gate: ruff, formatting, mypy, pytest, wheel/sdist build, and strict MkDocs build.
  • CI: lint, typecheck, tests on Python 3.10–3.13, compatibility on minimum/latest dependencies and pandas 3.x, build, installed-wheel smoke test, docs, and ci-success.

Full changelog: https://github.com/devlprkhan/universal-data-cleaner/blob/main/CHANGELOG.md

v2.9.1 — Hardening and provenance

Choose a tag to compare

@devlprkhan devlprkhan released this 11 Nov 16:50
aab2070

2.9.1 — Hardening release and provenance proof

This release publishes the hardening already merged to main and is the first
release built with the PEP 740 and GitHub build-provenance workflow.

Added

  • CI tests the minimum supported dependency versions on Python 3.10, the latest
    stable dependency set, and pandas 3.x.
  • CI installs the built wheel in a clean environment and checks imports, public
    exports, the CLI, and a small end-to-end cleaning workflow.
  • Release builds generate PEP 740 attestations for PyPI and GitHub
    build-provenance attestations, so published artifacts can be verified against
    the workflow that built them.

Changed

  • iter_csv_safe() infers the schema from the first chunk and reuses it for every
    later chunk. A later value that does not fit the inferred type is reported as
    unparseable_values instead of silently changing the column dtype. Pass an
    explicit contract when the first chunk may not be representative.
  • Safe ingestion enforces ColumnSpec(unique=True) and reports
    duplicate_values. Duplicates are detected within a frame and, for
    iter_csv_safe(), across chunks. Missing values are ignored.
  • DataContract.check() ignores missing values for unique=True, matching the
    documented "non-null values must be unique" behavior and the validation helper.
  • DataCleaner.transform() documents that a missing fitted input column is always
    fatal, regardless of on_drift, because the cleaner cannot safely reconstruct
    it.

Provenance

2.9.0 predates the attestation workflow and correctly shows no PyPI provenance.
2.9.1 is the first attested release. Verify a downloaded artifact with:

uvx "pypi-attestations==0.0.31" verify pypi \
  --repository https://github.com/devlprkhan/universal-data-cleaner \
  pypi:universal_data_cleaner-2.9.1-py3-none-any.whl

gh attestation verify universal_data_cleaner-2.9.1-py3-none-any.whl \
  --repo devlprkhan/universal-data-cleaner

Full changelog: https://github.com/devlprkhan/universal-data-cleaner/blob/main/CHANGELOG.md

v2.9.0 — Reliability hardening

Choose a tag to compare

@devlprkhan devlprkhan released this 10 Nov 13:18
994ffbe

2.9.0 — Reliability hardening

This release hardens the paths that already exist rather than adding another data primitive.

Added

  • ColumnSpec(required=...) marks a contract column as required or optional.
  • ArtifactCompatibilityError is raised by DataCleaner.load() when a saved artifact has an incompatible artifact format or library major version. Use allow_incompatible=True to load it with a warning, or verify_version=False to skip the check.
  • iter_csv_safe() streams a large CSV in typed chunks and yields one (frame, IngestionReport) pair per chunk, using bounded memory.
  • CleanerConfig.outlier_columns names the numeric columns that may be capped. When set it acts as an allowlist and overrides cap_outliers.
  • read_csv_safe() emits an integer_precision warning for integer values beyond 2^53 that are coerced to float64.

Changed

  • DataCleaner.fit() now validates an explicit contract before learning and raises ValueError when a required training column is missing. Columns with required=False or role="ignore" may be absent.
  • diagnose_join() computes matched and unmatched rows from grouped key frequencies, so duplicated keys no longer expand into a many-to-many join.
  • Outlier clipping is now opt-in: CleanerConfig.cap_outliers defaults to False. Set it to True, or list outlier_columns, to keep the previous clipping behavior.
  • CSV ingestion normalizes blank cells in place instead of copying the whole frame.
  • The public API is documented in stable, experimental, and internal tiers with a deprecation policy. data_cleaner.__all__ is the canonical surface.
  • Refined the documentation site chrome and navigation.

Migration notes

  • If you relied on outlier clipping, set cap_outliers=True or list the columns in outlier_columns.
  • Incompatible artifacts now raise by default. Retrain and resave, or pass allow_incompatible=True only if you accept the risk.

Full changelog: https://github.com/devlprkhan/universal-data-cleaner/blob/main/CHANGELOG.md

v2.8.0 — Excel ingestion

Choose a tag to compare

@devlprkhan devlprkhan released this 06 Nov 11:24
c86a345

Added

  • read_excel_safe(): read one Excel worksheet, normalize every cell to text, apply the same contract-driven guards as read_csv_safe(), and return the typed frame with an IngestionReport.
  • Worksheet selection with sheet_name, accepting a name or a non-negative zero-based index. The resolved sheet is recorded on IngestionReport.sheet.
  • CleanerReport.from_excel(): attach Excel ingestion findings to the same profile, contract, validation, and decision report as CSV input.
  • data-cleaner audit now detects .xlsx, .xlsm, .xls, .xlsb, and .ods input and accepts --sheet NAME or --sheet-index N.
  • numeric_identifier warning when a contract ID column is stored as numbers in the spreadsheet and has already lost its leading zeros.
  • Optional excel extra (openpyxl>=3.1) for .xlsx and .xlsm workbooks. read_csv_safe() remains dependency-free.
  • Per-cell date guards so one datetime column can mix real dates, compact YYYYMMDD values, and Excel serials.
  • Duplicate column headers after string conversion are rejected with a clear error.
  • URL source labels are stored without credentials or query strings.

Documentation

  • Excel sections across the ingestion, reporting, quickstart, production, and API guides.
  • README install extra and feature list, CHANGELOG, ROADMAP Tier 7, and Upcoming.

Notes

  • IngestionReport gains sheet (default None) and location; both to_markdown() and warning/error messages name the resolved sheet.
  • IngestionReport.raise_if_failed() defaults to the format-neutral message "Ingestion failed"; read_csv_safe() and read_excel_safe() still name their format.
  • Real Excel date cells are parsed directly. Numbers in a datetime column are treated as Excel serial dates and flagged with excel_serial_date.
  • Excel cannot preserve leading zeros in a cell stored as a number. The reader warns with numeric_identifier, but store identifiers as text to avoid the loss.
  • .xls, .xlsb, and .ods files need the matching pandas engine (xlrd, pyxlsb, or odfpy); the excel extra covers .xlsx and .xlsm.
  • Artifact format remains 2; this release is additive.

v2.7.0 — Batch reporting

Choose a tag to compare

@devlprkhan devlprkhan released this 05 Nov 16:13
ecde210

Added

  • CleanerReport: one review object per batch combining the dataset profile, contract drift, validation results, ingestion findings, and the fitted cleaner's decision log.
  • from_frame(), from_csv(), and from_cleaner() entry points that never transform the input or re-fit the cleaner.
  • A tidy findings table plus errors, warnings, success, summary(), to_markdown(), to_dict(), to_json(), and raise_if_failed().
  • Profile warnings for empty datasets, empty columns, constant columns, high missingness, and duplicate rows.
  • python -m data_cleaner audit data.csv and the data-cleaner console script with --contract, --cleaner, --name, --format markdown|json, --output, --no-profile, and --fail-on-warning.
  • Stable CLI exit codes: 0 success, 1 error findings (or warnings with --fail-on-warning), 2 input or configuration errors.

Documentation

  • New Batch reporting guide with API and CLI examples.
  • Updated API reference, nav, homepage, quickstart, production guide, ingestion cross-links, artifacts, README, CHANGELOG, ROADMAP, and Upcoming.

Notes

  • CleanerReport.from_csv() defaults to on_error="ignore" so a report is always returned; error findings still make success false.
  • Reports contain column names, counts, and messages only; they never include raw cell values.
  • The CLI reads with on_error="ignore" and derives failure from the report.
  • Artifact format remains 2.

v2.6.0 — Safe CSV ingestion

Choose a tag to compare

@devlprkhan devlprkhan released this 03 Nov 06:41
b22b087

Added

  • read_csv_safe(): string-first CSV ingestion with contract-driven coercion and an IngestionReport covering per-column detection, output dtypes, missing counts, and every normalization performed.
  • Identifier protection: ID columns and values with leading zeros stay text, with leading_zeros_preserved findings.
  • Spreadsheet artifact handling for numeric fields: thousands separators, currency symbols, percent signs, accounting parentheses, and decimal commas.
  • Date guards for compact YYYYMMDD values and Excel serial dates when the contract declares role="datetime", plus explicit date_format support and an ambiguous_date_format warning.
  • Boolean normalization for Y/N-style tokens with boolean_tokens findings.
  • IngestionError and the on_error="warn" | "raise" | "ignore" policy.
  • mixed_types and empty_column findings.

Documentation

  • New Safe ingestion guide and Upcoming page.
  • Updated API reference, nav, homepage, quickstart, production guide, leak-safe workflow, README, CHANGELOG, and ROADMAP.

Notes

  • The ingestion report contains column names, counts, and messages only; it never includes raw cell values.
  • Without a contract, YYYYMMDD and Excel serial values remain numeric. Declare a datetime role when they are dates.
  • CSV is the supported input for this release; Excel ingestion is planned.
  • Artifact format remains 2.

v2.5.2

Choose a tag to compare

@devlprkhan devlprkhan released this 22 Oct 16:19
f58d7fd

Documentation-only release

2.5.2 makes the documentation site the single source of truth and publishes the streamlined README to PyPI.

Documentation

  • README is now a concise front door: install, quick start, leak-safe example, feature summary, docs index, development workflow, and project layout.
  • Duplicated contract, validation/join, ML audit, manifest, pipeline, public API, and production guides were removed from the README.
  • Added Artifacts & reproducibility and a Production guide to the docs site.
  • Every guide is linked from the README and the docs navigation.

Notes

v2.5.1

Choose a tag to compare

@devlprkhan devlprkhan released this 22 Oct 16:06
30dca21

Documentation-only release

2.5.1 publishes the documentation site as the central reference from both GitHub and PyPI.

Documentation

  • Add a MkDocs Material documentation site with task guides, an API reference, generated changelog, search, and dark mode.
  • Expose the documentation site in the package project URLs and README.

Notes