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
- 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
- Run diffino:
diffino run config.yaml
- 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.extpatterns, with manual override in YAML - Changelog generation:
diffino changelog generate— version summary table + detailed per-version diffs - Release date config:
releases.yamlmaps 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63a385b12adbc399387c7d7263ba66873dd8d7c1b1b6322a1feda81766eeea19
|
|
| MD5 |
3ee3e647ccf0902f309611326300c920
|
|
| BLAKE2b-256 |
dbb0453e746c7eb554243481be6bef087bc7a0aab276461c2d2949bb25ca90f2
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5b035b564c992828f007a1c3f14f4a4ede0765dcae12bbe2f7db0f9bb801b84
|
|
| MD5 |
18625f48851778134de6d315be043617
|
|
| BLAKE2b-256 |
a15d8ac05555fa7597ddbbc7d863058a6b66d33f6b6a20450491073ae8eb3e83
|