Detectors
Postal Code (PL)
Detect and validate Polish postal codes in DD-DDD format.
Purpose
Use the postal_code detector (region pl) for Polish postal codes (kod pocztowy).
This detector uses pattern matching with Polish postal code format validation.
Detector Name
postal_codeRegion: pl
Supported Formats
DD-DDD(standard 5-digit format with hyphen)DDDDD(5-digit format without hyphen)
Polish postal codes always start with digits 00-99 representing postal regions.
Usage
from fastpii import FastPII, DEFAULT_PRIORITY
from fastpii.countries.pl import PolishPack
engine = FastPII(priority=DEFAULT_PRIORITY)
engine.register(PolishPack())
result = engine.detect("kod pocztowy 00-950 Warszawa")Validation
result = engine.validate("00-950", "postal_code")
# result.is_valid → TrueMetadata
- Region code format validation
- Hyphen-normalized output