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
File details
Details for the file py_redact-datumbrain-0.0.3.tar.gz
.
File metadata
- Download URL: py_redact-datumbrain-0.0.3.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0c908a6a3e59ffb16d4518ea9902b945bd7c4bcc73a3e61ffb6a00e42f106e4 |
|
MD5 | 2386f5c7e7cec23ee7214ce8c8e593e5 |
|
BLAKE2b-256 | 30904e32eab183e31e2781c5de98c8f2d83604bd55c788430bf4ad9016017f46 |
File details
Details for the file py_redact_datumbrain-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: py_redact_datumbrain-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6dfa2b14eacbd0e2cd074e1061cdea461f6b1bfdf95dc34bf52cef31f7d9295 |
|
MD5 | 8030436fb1490787a1ab54673e65288c |
|
BLAKE2b-256 | f5db086fe8525a9bf8475a8ab83fe4e30350933ec555836bb3965ca1c1adb8b2 |