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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dhi-1.1.18.tar.gz.
File metadata
- Download URL: dhi-1.1.18.tar.gz
- Upload date:
- Size: 44.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cba6988f1dd98a716a0f56c1715c805ad9e2307f7123d7753affdc7415f5dd97
|
|
| MD5 |
359a5f3304ea6dcb21767fa643d6e203
|
|
| BLAKE2b-256 |
7c2f79f4740a4b6bcca3ea6e0dd55153399f5e653b36320c454c5bebef9c200a
|
File details
Details for the file dhi-1.1.18-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: dhi-1.1.18-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 255.3 kB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
139215b83d85732eef834053116bea67eac75816e89387b07b7d708840c48934
|
|
| MD5 |
62c1ce5e7295ed8d1b4261559030f2fb
|
|
| BLAKE2b-256 |
b53b738cc21a04ced9504b0ed25a67a3b03f7cd98a3e37a7b99ea68f305f2774
|
File details
Details for the file dhi-1.1.18-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dhi-1.1.18-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 258.4 kB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfa133a5bb580a8d692297ed8c417abdf169d8ae9c0857095a89c71ed2be167c
|
|
| MD5 |
5854c0c503109da79b8bfe3894bb8f0b
|
|
| BLAKE2b-256 |
98c22f5fe35af1c4307aa553354ebedfadebc048696e70d092803879dbf796ce
|
File details
Details for the file dhi-1.1.18-cp313-cp313t-macosx_13_0_arm64.whl.
File metadata
- Download URL: dhi-1.1.18-cp313-cp313t-macosx_13_0_arm64.whl
- Upload date:
- Size: 91.6 kB
- Tags: CPython 3.13t, macOS 13.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e15d9693997889d62aee2f04cea7615e372726ed211287e0f70cc5fdbd8b21cd
|
|
| MD5 |
85a198afb59acd34aa10180516b40819
|
|
| BLAKE2b-256 |
1a5496668de219a95af8c9a8b5dd7ac24b68b841a44eda498766e5fe772ab604
|
File details
Details for the file dhi-1.1.18-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: dhi-1.1.18-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 214.9 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52cd5dc88ce454d19120e9dcb2d64f6f2e5fc0f2fcbe85aaed8887ac2773b271
|
|
| MD5 |
a123a949ff682ac6b5245d770ee07aa7
|
|
| BLAKE2b-256 |
6afa557d2a398a68b5e2b4504105442392743c6ca896639a4571ca0b5b199693
|
File details
Details for the file dhi-1.1.18-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dhi-1.1.18-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 216.7 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96ffbb425a23e5a1f614d890556bfb77a616c5a42df70520529982446ad15388
|
|
| MD5 |
da96c159b8a31256ca15917f30ab180c
|
|
| BLAKE2b-256 |
6df0a08eb1ae3d8e79d7aa4a8a14be2a302e97f0b91841076124e78d86ef3f52
|
File details
Details for the file dhi-1.1.18-cp313-cp313-macosx_13_0_arm64.whl.
File metadata
- Download URL: dhi-1.1.18-cp313-cp313-macosx_13_0_arm64.whl
- Upload date:
- Size: 89.5 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9956f98c9f26bb24dd640ccaca84822336b19269429e67d890132ccedbe187e0
|
|
| MD5 |
09c55c89a1145114faae8a68d180e184
|
|
| BLAKE2b-256 |
c6c2ad0cda12e79b19c6b7b4cecde6df8bef98324060fa5bed9b949341449b9c
|
File details
Details for the file dhi-1.1.18-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: dhi-1.1.18-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 214.9 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4af3fe8cf8789761a4e191477e2d5338fc085f4ab003f618ce4bab3eed5d860
|
|
| MD5 |
7aa2e196de90100ec813ec02337702c5
|
|
| BLAKE2b-256 |
f16bba5e55f91607412bf2957605705229df10ce462795a1694cb3ff77898b49
|
File details
Details for the file dhi-1.1.18-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dhi-1.1.18-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 216.8 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7eb7f4d6909aaaa46eabb923a79677c06921185da5ba17ebce856e2ccfeffd2
|
|
| MD5 |
444957725db3785ec1cf19d719dc1c33
|
|
| BLAKE2b-256 |
df91cede880284b5b8edd289f7dbcb05925621d12c16ea7460caa3c83d77cbb0
|
File details
Details for the file dhi-1.1.18-cp312-cp312-macosx_13_0_arm64.whl.
File metadata
- Download URL: dhi-1.1.18-cp312-cp312-macosx_13_0_arm64.whl
- Upload date:
- Size: 89.5 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
520bf83dd5ea95131140d5db60ae9a5e4c6a9068a00d53298f5180d9f3797a88
|
|
| MD5 |
2963a959695173536c4d01038c56f88f
|
|
| BLAKE2b-256 |
6cd61a0887dd1d720169cd36cd0c72f09002c841a7f85f4e2953dc84aada63a1
|
File details
Details for the file dhi-1.1.18-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: dhi-1.1.18-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 209.7 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a6783133920340f8bed93cd30b4288067900ba56dc76039921c008585904547
|
|
| MD5 |
6e8b691e19c1046eb491079f765da9df
|
|
| BLAKE2b-256 |
9a7ecd47b380c3202eed04e7a8f92ffbb262ada9bd3d38be2035c2b48291cc2e
|
File details
Details for the file dhi-1.1.18-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dhi-1.1.18-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 211.3 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b05252c660d77ccdb7f7619baf7a27e97c0c01dee155dbe8e4c2976885fcf0dc
|
|
| MD5 |
240fe8af98a1805344a54d35479ea515
|
|
| BLAKE2b-256 |
a4d454419eee199ce75bcf42367a7125a7be75352ff4482eb29312b33eb15b18
|
File details
Details for the file dhi-1.1.18-cp311-cp311-macosx_13_0_arm64.whl.
File metadata
- Download URL: dhi-1.1.18-cp311-cp311-macosx_13_0_arm64.whl
- Upload date:
- Size: 89.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb16b0ccafe1bc32b369d5473ae9ea4a07722f6ade2be72a76fcdc2dc9c7ca05
|
|
| MD5 |
df612710ce968b053d1432c6e3755ff2
|
|
| BLAKE2b-256 |
596d068631c3cb438b60661bc05d8b02bbd19241d117a9c64c2102c51628dc8f
|
File details
Details for the file dhi-1.1.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: dhi-1.1.18-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 205.0 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
162ceaebab3d0afd06168290c7ab028c3a5d15494b3b2dfbdd745df9a6f716af
|
|
| MD5 |
cc6dc7f88e7df4fb699032ecc57af5fd
|
|
| BLAKE2b-256 |
bc5a2542b0fa0b870c05df5fd638d129d08f4b6b7e1f20612184618f9a6640f5
|
File details
Details for the file dhi-1.1.18-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dhi-1.1.18-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 206.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7e34e5bb82e0a1aece113bba2dc45fd5fe0e533c36904916160486078d4e5a4
|
|
| MD5 |
114244bcc916ce4281d1e99edd12f9d0
|
|
| BLAKE2b-256 |
046c7152f1d1df0ec5a41eb0ab79f39d676cab80b4e510537a84a362ee76398c
|
File details
Details for the file dhi-1.1.18-cp310-cp310-macosx_13_0_arm64.whl.
File metadata
- Download URL: dhi-1.1.18-cp310-cp310-macosx_13_0_arm64.whl
- Upload date:
- Size: 89.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29cd63a9296e5ad832e8cfdff3323c9fc9df9261b6ea80b3d9cbfeb266a12bc6
|
|
| MD5 |
c106ece1543a44cafac173f7f9bbe962
|
|
| BLAKE2b-256 |
149eaa3d973981baaa44a01508e2296650ad9b8e2a6c8a4cf83bb88f44cecf5b
|
File details
Details for the file dhi-1.1.18-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: dhi-1.1.18-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 204.4 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb1bab5d39041e6f401cd17f6e31f92e406f047e52a5354399625975633ffaf2
|
|
| MD5 |
56a65c668758bd89f6d0cc3ad8c0216e
|
|
| BLAKE2b-256 |
1bf223bdc1863aff70e88f089bf77e73934c79ca96ba04f6a8f8492e547ba525
|
File details
Details for the file dhi-1.1.18-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dhi-1.1.18-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 205.4 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f388f779eba822418cba66af41d60c733cfd4bdcc212cfc7c1013966e157793
|
|
| MD5 |
230f01de055576b26578aadf76c42da2
|
|
| BLAKE2b-256 |
735168ef3ff086c2df72b010c9f14d65a8af6c2f3347cd52852c3d7bebbfd7c8
|
File details
Details for the file dhi-1.1.18-cp39-cp39-macosx_13_0_arm64.whl.
File metadata
- Download URL: dhi-1.1.18-cp39-cp39-macosx_13_0_arm64.whl
- Upload date:
- Size: 89.2 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e002270346f3a801f60fa6910360f48d4635df20011a374a6a3f9c5b3b3d9663
|
|
| MD5 |
2775c5d537906f968b615f69b82a7f03
|
|
| BLAKE2b-256 |
04489fbf785d822b91f409abbb25c14812b1da8d40f9d789b366df3610d07d46
|