Expand description
PII detection.
Detects personally identifiable information in content.
Structsยง
- PiiDetector
- Detector for personally identifiable information.
- PiiMatch
- A detected PII match.
- PiiPattern ๐
- Pattern for detecting PII.
Staticsยง
- AU_
TFN_ ๐REGEX - Australian Tax File Number (TFN): 8-9 digits
- CA_
SIN_ ๐REGEX - Canada Social Insurance Number: 9 digits, often XXX-XXX-XXX or XXX XXX XXX
- CREDIT_
CARD_ ๐REGEX - DL_
REGEX ๐ - DOB_
REGEX ๐ - EMAIL_
REGEX ๐ - EU_
VAT_ ๐REGEX - EU VAT Number: Country prefix (2 letters) + country-specific format Common formats: AT + U + 8 digits, BE + 10 digits, DE + 9 digits, etc.
- IN_
AADHAAR_ ๐REGEX - Indian Aadhaar Number: 12 digits, often formatted as XXXX XXXX XXXX
- IN_
PAN_ ๐REGEX - Indian PAN (Permanent Account Number): 5 letters + 4 digits + 1 letter
- IP_
REGEX ๐ - PASSPORT_
REGEX ๐ - PHONE_
REGEX ๐ - SSN_
REGEX ๐ - UK_
NIN_ ๐REGEX - UK National Insurance Number: 2 letters + 6 digits + 1 letter (e.g., AB123456C) Letters may be separated by spaces or dashes
- ZIP_
REGEX ๐
Functionsยง
- deduplicate_
overlapping ๐ - Removes overlapping matches, keeping the first occurrence.
- is_
local_ ๐ip - Checks if an IP address is a local/private address.
- is_
zip_ ๐in_ address_ context - Checks if a ZIP code appears in an address context.
- pii_
patterns ๐ - Returns the list of PII patterns to check.