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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab2e11fd0fb33320bdd318eaa1c67c99fb6e571031830f103a8e1b246ba1f17a |
|
MD5 | 95b08f084cff605b073e9cf93b4a100e |
|
BLAKE2b-256 | afe56896b90be20a945298a09826d98b8891d37d2982a4343490725e55c21eac |
Close
Hashes for py_redact_datumbrain-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38ae6d8c38f0b5684ca32371bfdd525c2d43366bb70e6afeca90173c84df0ca9 |
|
MD5 | 627885b31bad7d2fe7fb7694a769903d |
|
BLAKE2b-256 | e27bd7a00c4e84a8824100d6487d0a4961a9382d2f554b625b361c0655ab548a |