1. GroupDocs Documentation
  2. /
  3. GroupDocs.Redaction Product Family
  4. /
  5. GroupDocs.Redaction for Python via .NET

GroupDocs.Redaction for Python via .NET

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Redaction MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-redaction -- dnx GroupDocs.Redaction.Mcp --yes
Folders, licensing and more →
groupdocs-redaction-python-net-home PyPI package PyPI downloads

Release notes Download from PyPI Online app

GroupDocs.Redaction for Python via .NET is a document redaction API that permanently removes sensitive or classified content from documents across many formats. It provides a unified, format-independent interface to redact text by exact phrase or regular expression, scrub or rewrite metadata, black out image areas, rewrite or delete annotations, and remove pages — then save the result in its original format or as a rasterized PDF so redacted content cannot be recovered.

Quick example

from groupdocs.redaction import Redactor
from groupdocs.redaction.redactions import ExactPhraseRedaction, ReplacementOptions

# Redact every occurrence of "Emily Johnson" and save the result as a rasterized PDF
with Redactor("sample.docx") as redactor:
    redactor.apply(ExactPhraseRedaction("Emily Johnson", ReplacementOptions("[personal]")))
    redactor.save()

Features

  • Text Redaction: Replace or hide text matched by an exact phrase (case-sensitive or RTL-aware) or a regular expression, with a replacement string or a colored box.
  • Text in Images: Redact text in scans and embedded images through the OCR engine of your choice, such as Tesseract.
  • Metadata Redaction: Erase or rewrite document metadata, wholesale or filtered by property.
  • Image & Annotation Redaction: Black out image areas, clean embedded image metadata, and rewrite or delete annotations.
  • Page Removal & Rasterization: Remove pages or page ranges, and optionally flatten the result to a rasterized PDF (with PDF/A compliance) so redacted content is unrecoverable.
  • Redaction Policies: Describe a reusable set of redactions as a policy and apply it across many documents.
  • Review and Previews: Approve or reject each match in a callback, log what the engine does, and render page previews to images.

Supported File Formats

GroupDocs.Redaction redacts 40+ file formats. For the complete list, and what each redaction does on each format, see the full list of supported formats.

  • Microsoft Office (Word, Excel, PowerPoint, including templates and macro-enabled files)
  • PDF (standard PDFs, PDF/A output)
  • OpenDocument (ODT, OTT, ODS, OTS, ODP, OTP)
  • Images (JPEG, PNG, GIF, BMP, TIFF, WEBP, DjVu)
  • Text and Web (TXT, RTF, CSV, TAB, Markdown, HTML)

Getting Started

To get started, refer to the System Requirements, Supported File Formats, Installation, and Hello, World! sections for setup instructions and your first redaction.

Developer Guide

For practical, runnable code examples covering basic and advanced redaction, see the Developer Guide section. It walks through loading documents, applying text, metadata, image, annotation, and page redactions, saving and rasterizing results, and building reusable redaction policies.

AI Agents & LLM Integration

Using an AI coding assistant? The AI Agents & LLM Integration page covers the bundled AGENTS.md reference, the GroupDocs MCP server, and machine-readable documentation.

Technical Support

If you experience any issues or have suggestions, see Technical Support for the available channels — the free support forum and the paid helpdesk. For licensing and evaluation questions, see Licensing and Evaluation.