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.

turbodiff speed

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(...).

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.

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.1.2.tar.gz (438.0 kB view details)

Uploaded Source

Built Distributions

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

turbodiff-1.1.2-cp38-abi3-win_amd64.whl (222.4 kB view details)

Uploaded CPython 3.8+Windows x86-64

turbodiff-1.1.2-cp38-abi3-manylinux_2_34_x86_64.whl (371.8 kB view details)

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

turbodiff-1.1.2-cp38-abi3-macosx_11_0_arm64.whl (320.5 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for turbodiff-1.1.2.tar.gz
Algorithm Hash digest
SHA256 9fa1bf204379ed050ef94aed2b09ef7ecb7d565a3a091fc4da0faba3b3e3e585
MD5 75706846765053415f5854fb9103c191
BLAKE2b-256 4708112647ef8affd68ac4846f35f4d8d2b0fb93af28253fb0aac746147b56c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for turbodiff-1.1.2.tar.gz:

Publisher: ci.yml on BrightNight-Energy/turbodiff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turbodiff-1.1.2-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: turbodiff-1.1.2-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 222.4 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for turbodiff-1.1.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e464135bea48f498a2855f5e44ac00919c8f440def5bf23477f20aa816f8ec2f
MD5 eeecf6a195051a57a3a1a83b65d3a406
BLAKE2b-256 9d29f2548fcf68de6cfea01b3b32450a6620f5d7371f861fb462d91484f184e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for turbodiff-1.1.2-cp38-abi3-win_amd64.whl:

Publisher: ci.yml on BrightNight-Energy/turbodiff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for turbodiff-1.1.2-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1fc8de209e6f6345b326131c694bbf032cb65f07dae8d36e2c9f72aa7c6d574e
MD5 1e491ba8588679e4ed6b9ceee7e31eea
BLAKE2b-256 0b0d84cff86b71db3adc5d7e801bd26ec3258c74b7dcd76c6d9123d90c0ed35d

See more details on using hashes here.

Provenance

The following attestation bundles were made for turbodiff-1.1.2-cp38-abi3-manylinux_2_34_x86_64.whl:

Publisher: ci.yml on BrightNight-Energy/turbodiff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turbodiff-1.1.2-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for turbodiff-1.1.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c98012f0ea927589a148f67a8543e92b84014a85928345433183eb5364992136
MD5 150ab33da33583b76b78a931029dea03
BLAKE2b-256 efef7d1dbaf191c7c0794a504fbe290416a1d10a28d452e6986d263373d1a038

See more details on using hashes here.

Provenance

The following attestation bundles were made for turbodiff-1.1.2-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: ci.yml on BrightNight-Energy/turbodiff

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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