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.3.1.tar.gz (24.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.3.1-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: diffino_cli-0.3.1.tar.gz
  • Upload date:
  • Size: 24.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.3.1.tar.gz
Algorithm Hash digest
SHA256 4a1a21b10994a1c51072b17eae4d75a3ad3cbfc0f53bbf045324943b8087bbed
MD5 2d04b64e38ad33bcc3ed3afd34abf373
BLAKE2b-256 9dd03858a24fecb0986a6c59fe60621a3389f90b6ade79896b7c3dfbb9be505a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: diffino_cli-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 28.2 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47362903754dbe6b31f5a912c3825622ec7c43c85e66c7a3bfd105bc81ea529c
MD5 b9ff75b1f3452e9062d240f6ec890a9e
BLAKE2b-256 c6fbb9e786e07f4e6816d89bd70e9313fa534d4fe2d6ae9b7572e2987748f236

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