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.3.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for py_redact-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c88fe8695474d7c8f20314ee22f8fc1547c109d8ca5651600270cebba0fb9d1c |
|
MD5 | 1484bfe14afd03cf3de839eeba9ab9fd |
|
BLAKE2b-256 | d0e2f717d7aea343ede53a1a36d14f1102927633e2b3a1b6e457cc311fc37370 |