A lightweight, zero-dependency Python utility to detect and redact India-native PII patterns, aligned with the DPDP Act 2023.
Most PII scrubbers are built for Western data patterns (SSN, Zip Codes). dpdpa-pii-scrubber is built specifically for Bharat. It identifies identifiers that are critical under India's Digital Personal Data Protection (DPDP) Act, ensuring your AI logs and datasets remain compliant.
- 🔍 Aadhaar Detection: Supports 12-digit formats with varied spacing.
- 💳 Financial Identifiers: PAN cards, IFSC codes, and UPI IDs.
- 🛂 Identity Docs: Indian Passports and Voter IDs.
- 📱 Soft PII: Mobile numbers (+91) and email addresses.
- ⚡ Zero Dependency: Built entirely on Python's standard library.
# Clone and use directly in your project
git clone https://github.com/TheIndicSentinel/dpdpa-pii-scrubber.gitfrom scrubber import DPDPScrubber
scrubber = DPDPScrubber(mask_char="X", preserve_length=True)
text = "Payment received from user@upi for Aadhaar 1234-5678-9012"
scrubbed = scrubber.scrub(text)
print(scrubbed)
# Output: Payment received from XXXXXXXX for Aadhaar XXXXXXXXXXXXXX| Entity | Pattern Description |
|---|---|
| Aadhaar | 12-digit UIDAI standard |
| PAN | Permanent Account Number (Income Tax Dept) |
| UPI | Unified Payments Interface IDs (@oksbi, @ybl, etc.) |
| IFSC | Bank branch identifiers |
| Passport | Indian Passport numbering |
| Voter ID | EPIC numbers |
- Logging Sanitization: Scrub PII before sending logs to CloudWatch/Datadog.
- Dataset Preparation: Clean raw customer data before fine-tuning local models.
- Live Middleware: Redact sensitive info in real-time within Chatbot interfaces.
Building on the principles of the Digital Personal Data Protection (DPDP) Act 2023, this utility helps organizations fulfill:
- Data Minimisation: Collecting/storing only the data necessary for the purpose.
- Security Safeguards: Implementing technical measures to protect personal data.
Licensed under the Apache 2.0 License.
Built with conviction by TheIndicSentinel — Governance for Bharat.