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.1.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for py_redact-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6590bd99885bc4ebc45a2653b27399b25e35bd428256bc9fcdb0a48860a83d21 |
|
MD5 | 17ac0363e16258da8489445ea51d33a5 |
|
BLAKE2b-256 | b975b5b4702416b435d0f738b64a3b96cb7085ff3468d8613af4ad37f1b78752 |