A python package to redact documents by regexes.
Project description
py_redact
Document redaction library in Python.
Install Requirements
pip install py_redact
Example Usage
Redact Microsoft Word Document
from py_redact.docx_redactor import DocxRedactor
replace_char = '*'
regexes = [r"""\d{3}-\d{2}-\d{4}""", r"""(([a-zA-Z0-9_\.+-]+)@([a-zA-Z0-9-]+)\.[a-zA-Z0-9-\.]+)"""]
redactor = DocxRedactor(input_file, regexes, replace_char)
redactor.redact(output_file_path)
Redact Microsoft Power Point Slide
from py_redact.pptx_redactor import PptxRedactor
replace_char = '*'
regexes = [r"""\d{3}-\d{2}-\d{4}""", r"""(([a-zA-Z0-9_\.+-]+)@([a-zA-Z0-9-]+)\.[a-zA-Z0-9-\.]+)"""]
redactor = PptxRedactor(input_file, regexes, replace_char)
redactor.redact(output_file_path)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for py_redact-datumbrain-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18f08d944b2d0542597a627053f9d50d12bac79dbc509f18891f4fdeb49a17ab |
|
MD5 | ef20b6291bda5d96d624ffcdd658a1d1 |
|
BLAKE2b-256 | 5f400d6ba8e7c8652b1d1bc994f6ad9699661ecca3b78ea763740fca15d2e5ca |
Close
Hashes for py_redact_datumbrain-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13c03320b80f4219bef8de4c3a0fb49e8efbac2d770790653e39521041a972e6 |
|
MD5 | 8d4aad6343bb608b49b4636498a04c3a |
|
BLAKE2b-256 | 229ce87d76229971927aeddd682247f0f84c95e76f200a2410cc7f212b20ace2 |