FastPII Docs
Detectors

SIRET

Detect and validate French establishment identification numbers with Luhn checksum.

Purpose

Use the siret detector for French establishment identification numbers (SIRET — Système d'Identification du Répertoire des Établissements).

Detector Name

siret

Supported Formats

  • 14 digits: 73282932000074

SIRET is always exactly 14 digits. The first 9 digits form the SIREN, and the last 5 are the NIC (Numéro Interne de Classement).

Validation Logic

  1. Require exactly 14 digits.
  2. Extract the first 9 digits as SIREN.
  3. Validate the SIREN portion using Luhn checksum.
  4. Validate the full 14-digit number using Luhn checksum.

Checksum Algorithm (Luhn)

Same as SIREN validation, applied to the full 14-digit number.

Python Examples

from fastpii import FastPII
from fastpii.countries.fr import FrenchPack

priority = {"siret": 95, "siren": 100, "email": 70, "name": 50}
engine = FastPII(priority=priority)
engine.register(FrenchPack())
result = engine.detect("SIRET: 73282932000074", detector_names=["siret"])

Convenience API

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["fr"])
result = guard.validate("73282932000074", "siret")

print(result.is_valid)

Convenience API — Detect in free text

from fastpii import PrivacyGuard

guard = PrivacyGuard(regions=["fr"])
result = guard.detect("SIRET: 73282932000074")

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

Limitations

  • SIRET is specific to French establishment identification.
  • The detector requires context words like "SIRET" or nearby business terms to reduce false positives.
  • Both the SIREN portion and the full SIRET must pass Luhn validation.

On this page