FastPII Docs
Detectors

Bank Account

Detect and validate Czech bank account numbers using separate MOD 11 checks for prefix and base parts.

Purpose

Use the bank_account detector for Czech bank account numbers.

This detector reports accuracy above 99% and supports both prefixed and non-prefixed account forms.

Validation is delegated to the shared bank account validator, which parses the account and checks each numeric section independently.

Detector Name

bank_account

Supported Formats

  • [prefix-]base/bank_code

Examples:

  • 19-2000145399/0800
  • 2000145399/0800

The prefix is optional.

Validation Logic

FastPII first parses the value into three parts:

  • prefix (optional, 1-6 digits)
  • base (1-10 digits)
  • bank_code (exactly 4 digits)

The detector then validates the prefix and base separately.

Prefix Checksum

  1. Left-pad the prefix to 6 digits.
  2. Apply weights 10, 5, 8, 4, 2, 1 from left to right.
  3. Sum the products.
  4. The sum must be divisible by 11.

Base Checksum

  1. Left-pad the base to 10 digits.
  2. Apply weights 6, 3, 7, 9, 10, 5, 8, 4, 2, 1 from left to right.
  3. Sum the products.
  4. The sum must be divisible by 11.

Bank Code Rule

FastPII checks only that the bank code is exactly 4 digits.

It does not validate the bank code against a live CNB bank list.

Python Examples

Validate a bank account

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["cz"])
result = guard.validate("19-2000145399/0800", "bank_account")

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

Detect in free text

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["cz"])
result = guard.detect("Účet: 19-2000145399/0800", detector_names=["bank_account"])

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

Expected Metadata

When parsing succeeds, this detector returns:

  • bank_code
  • base
  • prefix when present

Example Output

{
    "bank_code": "0800",
    "base": "2000145399",
    "prefix": "19",
}

Limitations

  • Bank code existence is not checked against a current registry.
  • Invalid parse format returns limited metadata.
  • This detector validates Czech account structure only.

Notes

Verified validation example from the codebase:

guard.validate("19-2000145399/0800", "bank_account")

On this page