Vehicle Plate
Detect and validate Czech vehicle registration plates in both old and new format families.
Purpose
Use the vehicle_plate detector for Czech vehicle registration plates (SPZ / license plates).
This detector reports accuracy above 95% and supports both older plate patterns and newer regional-code variants.
It also extracts a region hint for the new-style format when the prefix matches the built-in regional map.
Detector Name
vehicle_plateSupported Formats
- Old format:
2-3 letters + 3-4 digits - New format: regional code variants such as
1A2 3456
Examples:
1A2 3456ABC 1234
Validation Logic
The detector evaluates two families of regex patterns.
New Format
- First block: regional code plus letters and digits
- Second block:
4-5alphanumeric characters
Old Format
3letters- Space
3-4digits
Plate Rules
After pattern matching, FastPII applies these checks:
- Reject any plate containing
Q. - For new plates, require total length without spaces between
6and8. - For old plates, require total length without spaces between
6and7. - Use the leading prefix to look up a known region for new-format plates.
There is no checksum algorithm for this detector.
Python Examples
Validate a vehicle plate
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["cz"])
result = guard.validate("1A2 3456", "vehicle_plate")
print(result.is_valid)
print(result.metadata)Detect in text
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["cz"])
result = guard.detect("SPZ: 1A2 3456", detector_names=["vehicle_plate"])
for finding in result.findings:
print(finding.value, finding.metadata)Expected Metadata
This detector can return:
plateformatregion
Old-format findings include plate and format, while new-format findings also include a region hint from the prefix map.
Example Output
{
"plate": "1A2 3456",
"format": "new",
"region": "Praha",
}Limitations
- Region metadata is based on the detector's internal prefix table.
- The detector validates structure, not registration authority records.
- Old-format plates do not expose the same regional metadata as new-format plates.
Notes
Verified validation example from the codebase:
guard.validate("1A2 3456", "vehicle_plate")