Turbodiff
Zero dependencies ✨ Rust-based 🦀 Super fast 🚀
Turbodiff is a super fast diffing library built from the ground up in Rust for speed and consistency. It focuses on core diffing behavior and exposes both a Rust API and Python bindings.
Credits
This project is inspired by and compatible with the design of DeepDiff.
It was vibe-coded with gpt-5.2-codex. Contributions are welcome.
Features
- DeepDiff-style output keys:
values_changed,dictionary_item_added,dictionary_item_removed,iterable_item_added,iterable_item_removed,type_changes - Options for order ignoring, numeric type tolerance, significant digits, epsilon comparisons, include/exclude paths, and verbose level
- Rust core + Python bindings via
pyo3/maturin
Status
This is an early, focused implementation. It targets the most common DeepDiff use cases and is intended as a drop-in replacement for the supported subset.
Installation (Python)
Install from PyPI with pip:
For local development builds, the Python package is built with maturin:
Installation (Rust)
Install from crates.io with cargo:
Usage (Python)
=
>
# Truthiness follows DeepDiff semantics
assert not # will raise AssertionError
Usage (Rust)
use json;
use ;
let t1 = json!;
let t2 = json!;
let diff = new;
println!;
let options = default.ignore_order;
let diff = with_options;
assert_eq!;
Pretty Output
=
=
= 3
= None
= 2
=
=
>
> │ - 2
> │ + 3
> ...
>
> ╰──
> ╰──
> + None
> ...
>
> │ - None
> │ + 2
>
> ╰──
> -
> +
# Compact output
>
> │ - 2
> │ + 3
> ...
>
> │ + None
> ...
>
> │ - None
> │ + 2
>
> │ -
> │ +
Supported keyword options (Python)
All options are passed as keyword arguments to DeepDiff(...).
| Option | Type | Behavior |
|---|---|---|
ignore_order |
bool |
Treat arrays as multisets (order-insensitive). |
ignore_numeric_type_changes |
bool |
Treat int/float type changes as value changes. |
ignore_string_type_changes |
bool |
Treat str/bytes type changes as value changes. |
ignore_type_in_groups |
list[tuple[type, ...]] |
Treat types in each group as compatible (type changes become value changes). Example: [(int, float), (bool, str)]. |
significant_digits |
int | None |
Compare numbers rounded to N significant digits. |
math_epsilon |
float | None |
Absolute tolerance for numeric comparison (alias for atol). |
atol |
float | None |
Absolute tolerance for numeric comparison. |
rtol |
float | None |
Relative tolerance for numeric comparison. Uses abs(a-b) <= max(atol, rtol * max(abs(a), abs(b))). |
include_paths |
list[str] |
Only diff paths that match these prefixes. |
exclude_paths |
list[str] |
Skip any paths that match these prefixes. |
verbose_level |
int (0 or 1) |
0 returns paths only for values_changed. |
Development
- Rust tests:
cargo test - Python tests:
pytest
Contributing
Issues and PRs are welcome. Please include a minimal repro and tests where possible.