Skip to main content

A command to mask secret information of images using OCR

Project description

A command to mask secret information of images using OCR.

Prerequisite

  • Python 3.3+

  • Tesseract

  • Languages for OCR (can be set by --lang, default is eng+jpn) must be available.

Installation

$ pip3 install masecret

You may need sudo.

masecret depends on pyocr and Pillow. If you fail to install Pillow, please see the installation instruction of Pillow.

Usage

Preparation

Create a SECRETS.txt in a current directory. Content of the file is regular expression patterns which match secret information you want to mask. You can includes multiple patterns using multi lines.

Example content of SECRETS.txt to mask AWS account number:

[-\d]{12,}

Mask Secret

Mask a single file:

$ masecret original.png masked.png

Mask multiple files (output directory must exist):

$ masecret original1.png original2.png ... masked_images/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

masecret-0.1.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page