Skip to main content

Rust-powered DeepDiff core

Project description

turbodiff logo

Turbodiff

PyPI - Version GitHub CI

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:

pip install turbodiff

For local development builds, the Python package is built with maturin:

maturin develop --features python

Usage (Python)

from turbodiff import DeepDiff

diff = DeepDiff({"a": 1}, {"a": 2})
print(diff.to_dict())
# {'values_changed': {"root['a']": {'old_value': 1, 'new_value': 2}}}

# Truthiness follows DeepDiff semantics
assert not diff # will raise AssertionError

Supported keyword options (Python)

All options are passed as keyword arguments to DeepDiff(...).

  • ignore_order: bool
  • ignore_numeric_type_changes: bool
  • ignore_string_type_changes: bool
  • significant_digits: int | None
  • math_epsilon: float | None
  • include_paths: list[str]
  • exclude_paths: list[str]
  • verbose_level: int (0 or 1)

verbose_level=0 returns paths only for values_changed.

Usage (Rust)

use serde_json::json;
use turbodiff::{DeepDiff, DeepDiffOptions};

let t1 = json!({"a": 1});
let t2 = json!({"a": 2});
let diff = DeepDiff::new(t1, t2);
println!("{}", diff.to_value());

let options = DeepDiffOptions::default().ignore_order(true);
let diff = DeepDiff::with_options(json!([1, 2]), json!([2, 1]), options);
assert_eq!(diff.to_value(), json!({}));

Development

  • Rust tests: cargo test
  • Python tests: pytest

Contributing

Issues and PRs are welcome. Please include a minimal repro and tests where possible.

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

turbodiff-1.0.0.tar.gz (369.2 kB view details)

Uploaded Source

Built Distribution

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

turbodiff-1.0.0-cp38-abi3-manylinux_2_34_x86_64.whl (344.2 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.34+ x86-64

File details

Details for the file turbodiff-1.0.0.tar.gz.

File metadata

  • Download URL: turbodiff-1.0.0.tar.gz
  • Upload date:
  • Size: 369.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for turbodiff-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8c3dd7bcf1073ed8c3e2a403286bdca0aea5abff56ec1eb25fcf53178901641f
MD5 76143d852e0d45aca1ef218da2b884a5
BLAKE2b-256 32d4f8c152c15b4b4edb155e227a30da1576adef7ddcbca776e81982441ea104

See more details on using hashes here.

File details

Details for the file turbodiff-1.0.0-cp38-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for turbodiff-1.0.0-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ef41cb93096472b0243dd2a680ab31cc1657a28e45a1cb4fbff4c50b9faddd45
MD5 163badf68699bb9ee215b0a5dacdfcb1
BLAKE2b-256 43d2ce14ae06f26950dea42554aa689aabb45e4ec2f3996410ae7832d4f1ea86

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