Skip to main content

Declarative data diff engine for tables, powered by Polars. Output Excel, HTML, or Typst PDF.

Project description

diffino

Declarative data diff engine for tables, powered by Polars. Compare Excel, CSV, or Parquet files and generate detailed reports with character-level inline diffs.

Installation

pip install diffino-cli

Quick Start

  1. Prepare a config file:
sources:
  left:
    type: excel
    path: data/left.xlsx
  right:
    type: excel
    path: data/right.xlsx

compare:
  - left_sheet: Sheet1
    key_columns:
      - ID
    ignore_columns:
      - Notes

output:
  formats:
    - excel
    - html
  1. Run diffino:
diffino run config.yaml
  1. View the generated reports.

Features

  • Multi-format sources: Excel, CSV, Parquet (DuckDB planned)
  • Key-based or fingerprint matching: Compare by composite keys or full-row hashes
  • Column preprocessing: Decimal rounding, text normalization, case sensitivity control
  • Character-level inline diff: Precise word-level change highlighting — red strikethrough for deleted text, green for inserted text
  • Three output formats:
    • Excel: Side-by-side old/new rows, yellow-highlighted changed cells with rich-text inline diffs ([-deleted-], [+inserted+])
    • HTML: Self-contained report with <del>/<ins> tags and JS filtering
    • Typst: Colored table report with character-level inline diffs — green for additions, red strikethrough for deletions, yellow for modified cells. Uses Zhuque Fangsong CJK font. Auto-escapes special characters and normalizes CJK punctuation for reliable compilation and text wrapping.
  • Excel styles:
    • track: old data baseline with changes overlaid inline — like Word track changes
    • final: new values with yellow highlights on changed cells
    • side_by_side: old row (red) + new row (green) for visual comparison
  • Change log sheet: Summary of all changes in a dedicated sheet

CLI Commands

diffino run config.yaml       # Run comparison
diffino validate config.yaml  # Validate config only

Configuration Reference

See config.example.yaml for a complete example. Key options:

Section Field Description
sources left / right File type (excel, csv, parquet) and path
compare[] left_sheet Sheet name in left file
compare[] right_sheet Sheet name in right file (defaults to left_sheet)
compare[] key_columns Column names used for row matching
compare[] fingerprint Use full-row hash instead of key columns
compare[] ignore_columns Columns to exclude from comparison
compare[] column_rules Preprocessing rules (decimal, text)
output formats List of excel, html, typst
output.excel style final or side_by_side

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffino_cli-0.2.6.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffino_cli-0.2.6-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file diffino_cli-0.2.6.tar.gz.

File metadata

  • Download URL: diffino_cli-0.2.6.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for diffino_cli-0.2.6.tar.gz
Algorithm Hash digest
SHA256 9d2400797247bd491521198ce160c63d7cad1b7428965bca23a6fc024cc5b27a
MD5 8edad5814b676990e3c3b563ab3db6a0
BLAKE2b-256 0ba8d6f14f61119d6e2160ff5c6176406029d42ae57a2e64958b25298df1a6a3

See more details on using hashes here.

File details

Details for the file diffino_cli-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: diffino_cli-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for diffino_cli-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3ac35a7cf4765e5d028539bf0567dc383b46fd81e72bc0ea9f6da73f1540f6e5
MD5 141468b3bf9c32905c66a25aab77741e
BLAKE2b-256 dfc4b74e5a8a4e0a2307f453f64b20f8752b7a94716c5ce6c3c82f778f5f57e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page