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.

Supports cumulative changelog generation across multiple versions.

Installation

pip install diffino-cli

Quick Start

  1. Prepare a config file:
sources:
  left:
    type: excel
    path: data/v0.2.5.xlsx
    version: "0.2.5"      # optional — auto-parsed from filename
  right:
    type: excel
    path: data/v0.2.6.xlsx
    version: "0.2.6"

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

output:
  project: 我的项目           # cover page title: "我的项目对比报告"
  formats:
    - excel
    - html
    - typst
  save_report: true           # persist DiffReport JSON for changelog
  report_dir: ./diffs
  1. Run diffino:
diffino run config.yaml
  1. Generate cumulative changelog from saved reports:
diffino changelog generate --input-dir ./diffs --releases releases.yaml

Features

  • Multi-format sources: Excel, CSV, Parquet, DuckDB
  • 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: Red strikethrough for deleted text, green bold for inserted text
  • Three output formats:
    • Excel: Side-by-side old/new rows, yellow-highlighted changed cells with rich-text inline diffs
    • HTML: Self-contained report with <del>/<ins> tags and JS filtering
    • Typst: Typst PDF with cover page, colored tables, character-level inline diffs. Uses Zhuque Fangsong CJK font.
  • Typst cover page: Configurable project name — {{PROJECT}}对比报告
  • DiffReport persistence: Auto-save JSON reports ({old}__{new}.json) for changelog accumulation
  • Version auto-detection: Parses name-vX.Y.Z.ext patterns, with manual override in YAML
  • Changelog generation: diffino changelog generate — version summary table + detailed per-version diffs
  • Release date config: releases.yaml maps versions to release dates for changelog display
  • Excel styles: track, final, side_by_side

CLI Commands

diffino run config.yaml                  # Run comparison
diffino validate config.yaml             # Validate config only
diffino changelog generate               # Generate changelog.typ
  --input-dir ./diffs                    #   Directory of diff JSONs
  --output changelog.typ                 #   Output file
  --releases releases.yaml               #   Release dates
  --summary-keep 3                       #   Versions in summary

Configuration Reference

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

Section Field Description
sources.left/right version Manual version override (auto-parsed from filename)
output project Project name for Typst cover (default: 数据)
output save_report Persist DiffReport as JSON
output report_dir Directory for saved reports (default: ./diffs)
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, side_by_side, or track

Releases config (releases.yaml)

releases:
  - version: "0.2.5"
    date: 2026-05-19
  - version: "0.2.6"
    date: 2026-05-20

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.4.0.tar.gz (31.6 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.4.0-py3-none-any.whl (36.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: diffino_cli-0.4.0.tar.gz
  • Upload date:
  • Size: 31.6 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.4.0.tar.gz
Algorithm Hash digest
SHA256 63a385b12adbc399387c7d7263ba66873dd8d7c1b1b6322a1feda81766eeea19
MD5 3ee3e647ccf0902f309611326300c920
BLAKE2b-256 dbb0453e746c7eb554243481be6bef087bc7a0aab276461c2d2949bb25ca90f2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: diffino_cli-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 36.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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5b035b564c992828f007a1c3f14f4a4ede0765dcae12bbe2f7db0f9bb801b84
MD5 18625f48851778134de6d315be043617
BLAKE2b-256 a15d8ac05555fa7597ddbbc7d863058a6b66d33f6b6a20450491073ae8eb3e83

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