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
py_redact-0.0.5.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for py_redact-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f86f6824484b44449a2ac5fc270880cec9e22cf6b245f1ee8753a0e9035b2dd3 |
|
MD5 | 6173a23ab6ac4f47296f8c286564256e |
|
BLAKE2b-256 | 7561157784c8b593b9fe9f7ee0b0ff6c786861794cf28617d8632fba57a62f7a |