Skip to content

feat: add Turkey (TR) country-specific predefined recognizers #1973

@mrcuren

Description

@mrcuren

Summary

This issue proposes adding Turkey-specific PII recognizers to Presidio Analyzer, following the same pattern established by existing country-specific recognizers (e.g., German recognizers in #1828, UK recognizers in #1862).

Proposed Recognizers

1. TrNationalIdRecognizerTR_NATIONAL_ID

Turkish National Identification Number (TC Kimlik No / TCKN).

  • 11-digit number, first digit ≠ 0
  • Checksum validation based on the official Nüfus ve Vatandaşlık İşleri Genel Müdürlüğü (NVI) algorithm, widely documented in Turkish software engineering resources and referenced in KVKK compliance guidelines

2. TrLicensePlateRecognizerTR_LICENSE_PLATE

Turkish vehicle license plates (standard civilian format).

  • Format: [province_code 01-81] [1-3 letters] [2-4 digits]
  • Province code validation (01–81)
  • Scope: standard civilian plates only (diplomatic CD/CC and temporary S-plates are out of scope for this PR)
  • Examples: 34 ABC 1234, 06 A 123

3. TrPhoneNumberRecognizerTR_PHONE_NUMBER (lower priority)

Turkish mobile phone numbers.

  • Supports international (+90 5XX ...), national (0 5XX ...), and local (5XX ...) formats
  • Format-only validation (no operator prefix validation, as mobile number portability / MNP makes operator-based checks unreliable)
  • Reference: ITU-T E.164, Turkey country code +90

Implementation Plan

I plan to implement these in separate PRs to keep reviews focused:

  • PR 1: TrNationalIdRecognizer (TCKN) — highest value, well-defined algorithm
  • PR 2: TrLicensePlateRecognizer
  • PR 3: TrPhoneNumberRecognizer (if the approach is agreed upon)

All recognizers will be disabled by default in default_recognizers.yaml, placed under country_specific/turkey/, with full unit tests and documentation updates.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions