FastPII Docs
Detectors

DIČ

Detect and validate Czech VAT numbers by checking company, special, and individual number formats.

Purpose

Use the dic detector for Czech VAT numbers (DIČ).

This detector reports accuracy above 98% and supports company, special, and individual forms.

Instead of using one standalone checksum rule, it validates the numeric payload against the matching Czech identifier format.

Detector Name

dic

Supported Formats

  • CZ + 8 digits
  • CZ + 9 digits
  • CZ + 10 digits

The detector accepts input with or without the CZ prefix during validation.

Validation Logic

FastPII strips the CZ prefix if present, then applies length-based rules.

Company Form

  • 8 digits
  • Validated as an IČO
  • Uses the IČO weighted MOD 11 checksum logic

Special Form

  • 9 digits
  • FastPII accepts the value only when the first digit is 6

Individual Form

  • 10 digits
  • Validated as a Czech birth number
  • Uses the birth-number format and checksum logic

There is no separate DIČ-only checksum implementation in this detector.

Python Examples

Validate a company DIČ

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["cz"])
result = guard.validate("CZ25596641", "dic")

print(result.is_valid)
print(result.metadata)

Detect DIČ values in text

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["cz"])
result = guard.detect("DIČ: CZ25596641", detector_names=["dic"])

for finding in result.findings:
    print(finding.value, finding.metadata)

Validate an individual DIČ

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["cz"])
result = guard.validate("CZ8001011238", "dic")

print(result.is_valid)
print(result.metadata)

Expected Metadata

This detector returns one metadata field:

  • type: company, special, or individual

Example Output

{
    "type": "company",
}

Limitations

  • Special 9-digit DIČ values are only checked by the leading 6 rule.
  • The detector does not expose the nested IČO or birth-number metadata.
  • Input outside the CZ + 8-10 digits range is rejected.

Notes

Verified validation example from the codebase:

guard.validate("CZ25596641", "dic")

On this page