Catalog PyPI
Back to packageRELEASE DETAILS

0.1.3

PyPI

aadhaar-masking

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

Published6 Aug 2026
Direct dependencies5
Transitive dependenciesNot calculated

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.

Declared dependencies 5

Native requirements
5 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
opencv-python
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
opencv-python>=4.5.0runtime
numpy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
numpy>=1.20.0runtime
rapidocr-onnxruntime
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
rapidocr-onnxruntime>=1.3.0runtime
PyMuPDF
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
PyMuPDF>=1.20.0runtime
Pillow
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
Pillow>=9.0.0runtime

Distribution files

1 collected
aadhaar_masking-0.1.3.tar.gz

sdist · 10.14 KB · Python source

Source file

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_version:5dae295575b1c0c9ac349fd95af2ea82ecfc907bd73cdbbbb6cf1a885128b9a2

Other collected versions

View all collected versions →