Catalog PyPI
PACKAGE EXPLORERView in registry

aadhaar-masking

PyPI

A high-performance library for masking Aadhaar numbers in images and multi-page PDFs with C++ multi-threading support.

Versions collected1
Direct dependencies5From release 0.1.3
Last observed20 Oct, 16:52 UTC

README

Version 0.1.3 documentation

Aadhaar Masking Engine (aadhaar-masking)

PyPI Version License: MIT

A high-performance, color-preserving library for detecting and masking 12-digit Aadhaar card numbers in images (JPG, PNG, TIFF, WEBP) and multi-page PDF documents with C++ multi-threading acceleration and automatic Python ThreadPool fallback.


Features

  • Color Preservation: CLAHE red-channel background filtering is used only for text detection. The black masking box is applied directly to the original image, preserving colors, notebook lines, and ink clarity.
  • Multi-Page PDF Processing: Automatically splits multi-page PDFs, masks pages containing valid 12-digit Aadhaar numbers (with Verhoeff checksum validation), and recombines them into a single PDF.
  • Hybrid Multi-Threading Engine:
    • Uses native C++ std::thread execution pool via pybind11 when a C++ compiler is available.
    • Automatically falls back to Python ThreadPoolExecutor when C++ binary extension is unavailable.
  • Temporary File Cleanup: Intermediate OCR preprocessed files are cleaned up immediately after coordinate extraction.

Installation

pip install aadhaar-masking

Quick Start Usage

Python API

from aadhaar_masking import mask_aadhaar

# Mask an image file (JPG, PNG, TIFF, etc.)
mask_aadhaar("input_aadhaar.jpg", "masked_aadhaar.jpg")

# Mask a multi-page PDF document
mask_aadhaar("input_document.pdf", "masked_document.pdf")

Command Line Interface (CLI)

# Mask an image
aadhaar-masker input.jpg output_masked.jpg

# Mask a multi-page PDF
aadhaar-masker input_document.pdf output_masked_document.pdf

# Specify worker threads
aadhaar-masker input_document.pdf output_masked_document.pdf --threads 8

License

MIT License.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.36 Aug 20265

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
sohan-2001/leasds-aakash

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:52 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:edaae0655e2d4d7ea4c3d472bfb0757a6b99ab3996b05eac010680150f266512