Skip to content

About

High-performance Python utility to redact Bharat-native PII patterns (Aadhaar, PAN, UPI) aligned with DPDP Act 2023.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🧼 dpdpa-pii-scrubber

A lightweight, zero-dependency Python utility to detect and redact India-native PII patterns, aligned with the DPDP Act 2023.

License Python Focus

🛡️ Why This Exists

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.

✨ Features

  • 🔍 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.

🚀 Installation

# Clone and use directly in your project
git clone https://github.com/TheIndicSentinel/dpdpa-pii-scrubber.git

🛠️ Usage

from 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

🏛️ Patterns Supported

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

⚡ Use Cases

  • 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.

⚖️ Social Proof & Compliance Alignment

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.

Used By Compliance

⚖️ License

Licensed under the Apache 2.0 License.


Built with conviction by TheIndicSentinel — Governance for Bharat.

About

High-performance Python utility to redact Bharat-native PII patterns (Aadhaar, PAN, UPI) aligned with DPDP Act 2023.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages