idverify
ID verification library — OCR, MRZ parsing, screenshot detection, and age gate for government IDs.
Install
pip install idverify
Usage
from idverify import verify_id, check_age
with open('./passport.jpg', 'rb') as f:
buffer = f.read()
# Full verification
result = verify_id(buffer)
print(result.status) # "valid" | "expired" | "invalid"
print(result.documentType) # "passport" | "drivers_license" | ...
print(result.checksum) # "passed" | "failed" | "not_applicable"
print(result.screenshotDetected) # False
# Age gate only (no birthdate exposed)
age = check_age(buffer)
print(age.over18) # True
print(age.over21) # False
API
verify_id(buffer: bytes) -> VerificationResult
Accepts an image buffer (PNG, JPG, WebP). Returns:
| Field | Type | Description |
|---|---|---|
id |
str |
Unique scan UUID |
documentType |
str |
passport / drivers_license / national_id / unknown |
issuingCountry |
str |
ISO country code |
expiryDate |
str | None |
YYYY-MM-DD |
status |
str |
valid / expired / invalid |
checksum |
str |
passed / failed / not_applicable |
screenshotDetected |
bool |
EXIF-based detection |
confidence |
int |
0–100 |
over18 |
bool | None |
None if DOB not found |
over21 |
bool | None |
None if DOB not found |
check_age(buffer: bytes) -> AgeGateResult
Returns { over18: bool, over21: bool } without exposing the full birthdate.
How it works
- Preprocessing — OpenCV resizes, grayscales, normalizes, and sharpens the image
- OCR — pytesseract extracts all text
- MRZ parsing — looks for Machine Readable Zone lines, validates checksums with the
mrzpackage - Fallback extraction — regex-based date and country parsing if no MRZ found
- Screenshot detection — exifread checks for camera EXIF metadata (Make, Model)
- Age gate — calculates age from DOB without returning the raw date
Requirements
- Python 3.9+
- Tesseract OCR installed on your system
Install Tesseract
| OS | Command |
|---|---|
| macOS | brew install tesseract |
| Ubuntu/Debian | sudo apt-get install tesseract-ocr |
| Windows | Download from UB-Mannheim/tesseract |
License
MIT
Metadata
Release files for idverify 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| idverify-0.1.0.tar.gz | 9.9 kB | Without provenance | Details for idverify-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| idverify-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for idverify-0.1.0-py3-none-any.whl |
Total release size: 20.1 kB
Release files / idverify-0.1.0.tar.gz
| Download URL | idverify-0.1.0.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96681199d642c2e1d1c2bc02c2c2912a339b5824f1431a710a455c25b450f16f
|
|
BLAKE2b-256 checksum How to use checksums |
c7aa11c17dcaa7cc35be5804f277f467180abcfd8ac6794c870574d45c675a3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / idverify-0.1.0-py3-none-any.whl
| Download URL | idverify-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a97a29012aa93baf6ffd550c7d2d01c43980fcac0fbe8712c439ed6252e0d430
|
|
BLAKE2b-256 checksum How to use checksums |
4bc230e6c1037431fc0bfb268da9a7c2819ae330d298e2951f3684fecef71f3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for idverify 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.