Skip to main content

Ultra-fast data validation for Python - 28M validations/sec, 3x faster than Rust alternatives

Project description

dhi - Ultra-Fast Data Validation for Python

The fastest data validation library for Python. Powered by Zig for maximum performance.

🚀 Performance

28 million validations/sec - 3x faster than satya (Rust), 3x faster than msgspec (C)

# Validate 10,000 users in 0.36ms
from dhi import _dhi_native

users = [{"name": "Alice", "email": "alice@example.com", "age": 25}, ...]

field_specs = {
    'name': ('string', 2, 100),
    'email': ('email',),
    'age': ('int_positive',),
}

results, valid_count = _dhi_native.validate_batch_direct(users, field_specs)
# 28M users/sec! 🔥

✨ Features

  • �� Fastest: 3x faster than satya (Rust) and msgspec (C)
  • 🎯 24+ Validators: Email, URL, UUID, IPv4, dates, numbers, strings
  • 🔋 Zero Python Overhead: C extension extracts directly from dicts
  • 🌍 General Purpose: Works with any dict structure
  • 💪 Production Ready: Thoroughly tested and benchmarked

📦 Installation

pip install dhi

🎯 Quick Start

from dhi import _dhi_native

users = [
    {"name": "Alice", "email": "alice@example.com", "age": 25},
    {"name": "Bob", "email": "bob@example.com", "age": 30},
]

field_specs = {
    'name': ('string', 2, 100),
    'email': ('email',),
    'age': ('int_positive',),
}

results, valid_count = _dhi_native.validate_batch_direct(users, field_specs)
print(f"Valid: {valid_count}/{len(users)}")

�� Available Validators

String: email, url, uuid, ipv4, base64, iso_date, iso_datetime, string

Number: int, int_gt, int_gte, int_lt, int_lte, int_positive, int_non_negative, int_multiple_of

🏆 Benchmarks

dhi:     28M users/sec  🥇
satya:    9M users/sec  (3.0x slower)
msgspec:  9M users/sec  (3.1x slower)

📝 License

MIT License - see LICENSE file

🔗 Links

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

dhi-1.1.0.tar.gz (33.8 kB view details)

Uploaded Source

Built Distributions

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

dhi-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (106.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

dhi-1.1.0-cp313-cp313-macosx_13_0_arm64.whl (45.7 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

dhi-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (106.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

dhi-1.1.0-cp312-cp312-macosx_13_0_arm64.whl (45.7 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

dhi-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (106.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

dhi-1.1.0-cp311-cp311-macosx_13_0_arm64.whl (45.7 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

dhi-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (105.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

dhi-1.1.0-cp310-cp310-macosx_13_0_arm64.whl (45.7 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

dhi-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (105.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

dhi-1.1.0-cp39-cp39-macosx_13_0_arm64.whl (45.7 kB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

File details

Details for the file dhi-1.1.0.tar.gz.

File metadata

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

File hashes

Hashes for dhi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8a7d833bc46f756a698769c2b8303cb6b8ad74847c75b3e7ed52ee2736f4da9d
MD5 089fa340e5155dd428b4a2fd1e334bdb
BLAKE2b-256 b38fc4cd2be6c17245b55e60c342f5b6eda83927869e4066eb07c098b087a10f

See more details on using hashes here.

File details

Details for the file dhi-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dhi-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 feda2ba427ad3639908c9507c7ead830e3dbe296e937a7745a3e53d83cfb67c6
MD5 623c6c29f397a78130892872c7ef90b5
BLAKE2b-256 7455467df733e4161edcb6b0e20bc2e157dc94c8206b868b8a4e0c7f7530b56e

See more details on using hashes here.

File details

Details for the file dhi-1.1.0-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

  • Download URL: dhi-1.1.0-cp313-cp313-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: CPython 3.13, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dhi-1.1.0-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 031d2d3b59b5dbdc4cbab13f322e23119daa87c913fed876ab984f115e589475
MD5 2c39de543287493df4a52479055f7fb6
BLAKE2b-256 b22b63bf284360de30625287bec33a371ee9ac4dc79c203bcff702bc00175de6

See more details on using hashes here.

File details

Details for the file dhi-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dhi-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 69208130a8b969132de1426877dbc26375220f32b51083ee9a8a38cf27c82531
MD5 3fcf912aa5988978287a4b0f22af4a6b
BLAKE2b-256 0737bb66e6011052f469b647f0dd38ea09b8a47bbf2511f418c789c409bf3a45

See more details on using hashes here.

File details

Details for the file dhi-1.1.0-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

  • Download URL: dhi-1.1.0-cp312-cp312-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: CPython 3.12, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dhi-1.1.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 0125173e69ac73e7470819365641aee59c96a05227894e177d4ea84c3a477fb5
MD5 f8707a1be4b5e5a8ed59e3b1e550571a
BLAKE2b-256 0e85a57b9e4371ffd4cfa58d28426de4a48454095c9ef915904ce800ca338945

See more details on using hashes here.

File details

Details for the file dhi-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dhi-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8d2ad104d9e0b7b2006469406e0de014b3e66219d073c110c0dc79569bff884a
MD5 4f2626824841f288f6bf8712c65ae57a
BLAKE2b-256 1035728ec8c3d84601913fa79729ea10bcb427bb772de56bdcce310ec7fd883c

See more details on using hashes here.

File details

Details for the file dhi-1.1.0-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

  • Download URL: dhi-1.1.0-cp311-cp311-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: CPython 3.11, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dhi-1.1.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 6478c1f2483cfcc3d096e4267a689fc09c7b08a7cb89d9bbf4411efcece7f016
MD5 e89b50d22e2c562d5dba41aecdcd90b2
BLAKE2b-256 21d4080e0dd296f4a01575fcd52fbc9ad0a3ee5e194f7a1711437a8d11f43ce8

See more details on using hashes here.

File details

Details for the file dhi-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dhi-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3df568ed7da809e07ff799fb41a7a8b5d2f0226eb40f45fee25336f59551e80b
MD5 bb7c398fc1dd76b4e69fc83a3db0b397
BLAKE2b-256 596858f28347867794e0f76136699d9e92cee6f3c08b47c14ecac36c4d5ad415

See more details on using hashes here.

File details

Details for the file dhi-1.1.0-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

  • Download URL: dhi-1.1.0-cp310-cp310-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: CPython 3.10, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dhi-1.1.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 472111e53f1bfbeb68a647731c9158e2efd1d9857a76acaf341aa46f0a5f4e7c
MD5 4defc27913cff493f98bcdbb577063e7
BLAKE2b-256 cdbb2186dede493cdad9017f11bbb8af7ed7fa0d9f229f40cf7ab9d2b52533ae

See more details on using hashes here.

File details

Details for the file dhi-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dhi-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 358bc113f2a30e86ddb21d9b63ae1cac6c9dcff9895fd132e38ba21818cfeb35
MD5 6a969aa779e6104c76126ba47f699de3
BLAKE2b-256 c68483545b40fbc63e5b2a0213ec29679faf287e62588e5c1dbd08e11e58f0f6

See more details on using hashes here.

File details

Details for the file dhi-1.1.0-cp39-cp39-macosx_13_0_arm64.whl.

File metadata

  • Download URL: dhi-1.1.0-cp39-cp39-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: CPython 3.9, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dhi-1.1.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a06c08011aa9c680a9b2f04f5739ba764e1b839b03e3b745b9f12bb01599f9ba
MD5 410938c5ace06385ce5df43e0e6fe619
BLAKE2b-256 b666f5b23268c03b387f56db7548360085b2113646d6d093ab34e3395b96b7f2

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