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.0.11.tar.gz (12.5 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.0.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (83.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

dhi-1.0.11-cp313-cp313-macosx_13_0_arm64.whl (24.9 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

dhi-1.0.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (83.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

dhi-1.0.11-cp312-cp312-macosx_13_0_arm64.whl (24.9 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

dhi-1.0.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (82.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

dhi-1.0.11-cp311-cp311-macosx_13_0_arm64.whl (24.9 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

dhi-1.0.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (82.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

dhi-1.0.11-cp310-cp310-macosx_13_0_arm64.whl (24.9 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

dhi-1.0.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (82.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

dhi-1.0.11-cp39-cp39-macosx_13_0_arm64.whl (24.9 kB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for dhi-1.0.11.tar.gz
Algorithm Hash digest
SHA256 809a313b605af31420b04f677733ccd93293c4e6fe0a6bdda62ba7944376fd53
MD5 d6c17d46442fbaf1e6b2ab3011613595
BLAKE2b-256 4b8862867fefd69e50f506896c7bb43e272d5ab9dc52b11bebebf9a65739474f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dhi-1.0.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2220ae5129985f2220c8c2268d91591c56bf5a8393f9232377977929cac674de
MD5 653177c6a59b14f8468179a11b01da90
BLAKE2b-256 3c482c7f2e0f54acb061dcc2daceef87b9fa3219231e7d945522b0cca1d7b037

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dhi-1.0.11-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 63de0fc18dbee095343b73dd4068e8e1543064a279ac6f8a15b65d8ee0ec10e1
MD5 8e6c757c931dd88427c50fdb499dfc1d
BLAKE2b-256 4ef960ebf2418a5569f1949e31b35a16547754edf37ba77b27541f92565c5d15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dhi-1.0.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5aa732d11c35e39ab4eb606d62cdf4d88a85cce918880056d5656cc73a4e72c
MD5 11dce0b354763d9dc853dc513873cc3a
BLAKE2b-256 46967eaec36ca7d914386756ff19347a96ab29f34bffbd98526da1f6c7e1e4ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dhi-1.0.11-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 da42a72437500c80ab774dec39a765280afe9165b0f17a39b0605641556c40ac
MD5 47c15c46a93d4ce4d5c00cc930b4f03c
BLAKE2b-256 b752446a76489a36982cb2e2b869ecc8b5748334e50f33c560f01dfa77b87b19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dhi-1.0.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6b2513647d36015fc9f700b6bde8c88bb26e9f0ad2e9e63e0132472fe66395e
MD5 5f8a67a100d7641ac2feb7e6a2e0f316
BLAKE2b-256 f8b593901f245d62577b9d56c17b54aafa99e4cf50caeb7b68cabf614aa00a8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dhi-1.0.11-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 f62bc295e00efeffb43d95bc17656dec24e91b750edacc67236ca3be298f5c89
MD5 03c6d66a1dec878b293f5655ab2077ec
BLAKE2b-256 e8b051a055985ebf0d316951b310b5a9a85d2fa4942788dc756f2dba950a7122

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dhi-1.0.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95b51e1e758819c793a770f3c8e062d7d8476f5c7b88102135c665b751defb9b
MD5 746db129e8475126441b3c07afc4de55
BLAKE2b-256 a508bd289be364db00f90e48c8412627d7c5945d923906882450778217760ef6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dhi-1.0.11-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 52f82ff534cdb771553b4b599e49df7653ad1098049ce5331949e8429662b9aa
MD5 0f35856e3f54a8aa11472b5a76604148
BLAKE2b-256 5212385e12ecf4946a0a00d3899bd858cf15d8197db67f95de060de0b48c69cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dhi-1.0.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 13061110e7dfd17d2c44d5d689866445ac03ff5a521884781bc7aeb9d07a93a1
MD5 aad57b79468960c1a0d047f0dfa79a43
BLAKE2b-256 0ddb4506907c02222a8fce49c120d3a0d68a573ed3b3d12b4ed6d18ed53fa0b5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dhi-1.0.11-cp39-cp39-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 24.9 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.0.11-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 796d220187fe9b5be28ca608f971c0c99c2d022e93cec94b710789353982dc22
MD5 e36b0f320496a664e988ab9aa61be45c
BLAKE2b-256 2b51bda096690f5ab341f95366684ed9fd78cf75a3b4bed3c17a9793acfcd66b

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