Skip to main content

GroupDocs.Redaction for Python via .NET provides a reliable solution for redacting sensitive and confidential information across a wide range of document formats.

Project description

Document Redaction API

Product Page | Docs | Demos | API Reference | Blog | Search | Free Support | Temporary License

GroupDocs.Redaction for Python via .NET is a powerful redaction API that enables you to remove sensitive and confidential information from a wide range of document formats, including PDF, Microsoft Office files, images, and more. It supports text, metadata, annotation, and image redactions with advanced options like regular expressions.

Features

  • Comprehensive Redaction Options: Redact text, metadata, annotations, images, and more across supported formats.
  • OCR Integration: Redact text from scanned documents and image-based content using built-in OCR support.
  • Format-Agnostic Interface: Apply redaction operations consistently across multiple document types.

Supported File Formats

GroupDocs.Redaction supports a wide variety of file formats. For a complete list, see the full list of supported formats.

  • Microsoft Office (Word, Excel, PowerPoint)
  • PDF (Standard PDFs, PDF/A)
  • OpenDocument (ODT, ODS, ODP)
  • Images (JPEG, PNG, TIFF, BMP, GIF, WEBP)
  • eBook (DJVU)
  • Text/Markdown (TXT, CSV, RTF, MD)
  • HTML/Web (HTML, MHTML)

Get Started

Ensure that Python 3.9 and the .NET 6 runtime (or higher) are installed on your system.

To install the package, run:

pip install groupdocs-redaction-net

If you already have the package installed and want to update to the latest version, run:

pip install --upgrade groupdocs-redaction-net

Here are some common use cases to get started.

Example 1: Redact a Phrase in a Document

The following example shows how to redact a phrase in a DOCX file:

import groupdocs.redaction as gr
import groupdocs.redaction.options as gro
import groupdocs.redaction.redactions as grr

def run():
    # Specify the redaction options
    repl_opt = grr.ReplacementOptions("[personal]")
    ex_red = grr.ExactPhraseRedaction("John Doe", repl_opt)

    # Load the document to be redacted
    with gr.Redactor("source.docx") as redactor:

        # Apply the redaction
        result = redactor.apply(ex_red);
        
        # Save the redacted document
        so = gro.SaveOptions()
        so.add_suffix = True
        so.rasterize_to_pdf = False
        result_path = redactor.save(so)

Example 2: Redact Using Regular Expressions

This example demonstrates how to redact in PDF sensitive patterns like credit card numbers:

import groupdocs.redaction as gr
import groupdocs.redaction.options as gro
import groupdocs.redaction.redactions as grr
import groupdocs.pydrawing as grd

def run():
    # Specify the redaction options
    color = grd.Color.from_argb(255, 220, 20, 60);
    repl_opt = grr.ReplacementOptions(color)
    reg_red = grr.RegexRedaction(r"\b\d{4}-\d{4}-\d{4}-\d{4}\b", repl_opt)

    # Load the document to be redacted
    with gr.Redactor("source.pdf") as redactor:

        # Apply the redaction
        result = redactor.apply(reg_red);
        
        # Save the redacted document
        redactor.save()

Example 3: Redact Metadata from a Document

The following example demonstrates how to clean all metadata in a document:

import groupdocs.redaction as gr
import groupdocs.redaction.redactions as grr

def run():
    # Specify the redaction options
    met_red = grr.EraseMetadataRedaction(grr.MetadataFilters.ALL)

    # Load the document to be redacted
    with gr.Redactor("source.pdf") as redactor:

        # Apply the redaction
        result = redactor.apply(met_red);
        
        # Save the redacted document
        redactor.save()

More Resources

Find more details and examples in the GroupDocs.Redaction for Python via .NET documentation.

We also provide GroupDocs.Redaction packages for other platforms:


Product Page | Docs | Demos | API Reference | Blog | Search | Free Support | Temporary License

Project details


Release history Release notifications | RSS feed

This version

25.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

groupdocs_redaction_net-25.5.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

groupdocs_redaction_net-25.5-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file groupdocs_redaction_net-25.5.tar.gz.

File metadata

  • Download URL: groupdocs_redaction_net-25.5.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.4

File hashes

Hashes for groupdocs_redaction_net-25.5.tar.gz
Algorithm Hash digest
SHA256 49dfa79613d6f71b8908214c5933f89b61c57dfd8622ca09ace6d3f1b2482152
MD5 dc1a353e181a9c796760e0d42462c32f
BLAKE2b-256 22674ba6f19652fe96e59485eadb5dcd493dc0e34492e64afd76925cbefd298b

See more details on using hashes here.

File details

Details for the file groupdocs_redaction_net-25.5-py3-none-any.whl.

File metadata

File hashes

Hashes for groupdocs_redaction_net-25.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5aaf5dc7be0516ed256d89a5c5de8fed3d7f180ef0f29b77012720c7378edbef
MD5 84f0d38e7115e27bfe3fca071623cc5b
BLAKE2b-256 33f75042084cfb39f229e7bd1b44cc46c88324692343690d0a268bd3700e4e4a

See more details on using hashes here.

Supported by

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