Skip to main content

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


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 details)

Uploaded Source

Built Distribution

py_redact-0.0.5-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file py_redact-0.0.5.tar.gz.

File metadata

  • Download URL: py_redact-0.0.5.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

Hashes for py_redact-0.0.5.tar.gz
Algorithm Hash digest
SHA256 33e8980f52aa64e1b7f76efc79fb4df7444e9b7517f7e4c401250b03fe25e63f
MD5 e86a16995e75e951c880323c7f2274b9
BLAKE2b-256 3bc0bd2ab539e9a918ca646befadee1409ec3a6eb83d42280f00225540b34926

See more details on using hashes here.

File details

Details for the file py_redact-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: py_redact-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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

Hashes for py_redact-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f86f6824484b44449a2ac5fc270880cec9e22cf6b245f1ee8753a0e9035b2dd3
MD5 6173a23ab6ac4f47296f8c286564256e
BLAKE2b-256 7561157784c8b593b9fe9f7ee0b0ff6c786861794cf28617d8632fba57a62f7a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page