GroupDocs.Redaction for Python via .NET 26.6 Release Notes

GroupDocs.Redaction for Python via .NET 26.6 brings the full redaction capabilities of the underlying .NET library to Python, shipped as a self-contained wheel on PyPI. Permanently remove sensitive content from documents — redact text by exact phrase or regular expression, scrub or rewrite metadata, black out image areas, rewrite or delete annotations, remove pages, and rasterize the result so redacted content cannot be recovered — all on-premise, with no MS Office or OpenOffice required.

Full List of Changes in This Release

KeyCategorySummary
REDACTIONPYTHONNET-1BugColor replacement does not work for a DOCX document

Drawing a color box over matched text in a DOCX document now works correctly. The fix is demonstrated end-to-end — code example, source document, and redacted output — in the Use regular expression section of the documentation.

Installation

pip install groupdocs-redaction-net

Quick start

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

with Redactor("document.docx") as redactor:
    redactor.apply(ExactPhraseRedaction("John Doe", ReplacementOptions("[personal]")))
    redactor.save()

Major Features

Text redaction

Replace or hide text matched by an exact phrase (case-insensitive or case-sensitive, including right-to-left scripts) or a regular expression. Use a replacement string or draw a filled color box over the match.

from groupdocs.redaction.redactions import ExactPhraseRedaction, RegexRedaction, ReplacementOptions
from groupdocs.pydrawing import Color

redactor.apply(ExactPhraseRedaction("ACME", True, ReplacementOptions("[CO]")))   # case-sensitive
redactor.apply(RegexRedaction(r"\d{2}\s*\d{2}[^\d]*\d{6}", ReplacementOptions(Color.from_argb(255, 0, 0, 255))))

Metadata redaction

Erase metadata wholesale or by filter, or rewrite values that match a pattern.

from groupdocs.redaction.redactions import EraseMetadataRedaction, MetadataSearchRedaction, MetadataFilters

redactor.apply(EraseMetadataRedaction(MetadataFilters.ALL))
redactor.apply(MetadataSearchRedaction(".*@acme\\.com", "[EMAIL]"))

Image-area and annotation redaction

Black out a fixed rectangle on a page, rewrite or delete annotations, and clean embedded image metadata.

Page removal

Remove pages or page ranges from the start or end of a document.

Rasterization to PDF

By default, save() rasterizes the redacted document to a PDF and appends a _Redacted suffix so the underlying data cannot be recovered. Rasterization supports anti-extraction effects (noise, tilt, border, grayscale) and adjustable PDF/A compliance. Pass SaveOptions(rasterize_to_pdf=False) to keep the original format instead.

Reusable redaction policies

Describe a set of redactions as a RedactionPolicy — built in memory or loaded from an XML file — and apply it across many documents in a single call.

from groupdocs.redaction import RedactionPolicy

policy = RedactionPolicy.load("redaction_policy.xml")
redactor.apply(policy)

Pythonic, AI-friendly API

The entire .NET API is exposed through Python-native naming: classes use PascalCase, methods and properties use snake_case (auto-mapped to the underlying .NET PascalCase), and enum values use UPPER_SNAKE_CASE. The wheel bundles an AGENTS.md reference (discovered at groupdocs/redaction/AGENTS.md) for AI coding assistants such as Claude Code, Cursor, and GitHub Copilot, and the documentation is available in an LLM-optimized form and via the GroupDocs MCP server.

Supported Document Formats

CategoryFormats
Word ProcessingDOC, DOCX, DOCM, DOT, DOTX, ODT, RTF, TXT
SpreadsheetsXLS, XLSX, XLSM, ODS, CSV
PresentationsPPT, PPTX, PPTM, ODP
Fixed-LayoutPDF
ImagesJPG, JPEG, PNG, GIF, BMP, TIFF

See the full list on the supported document formats page.

Public API Surface

Classes

  • Redactor — entry point; open by path or stream, apply(), save(), get_document_info()
  • RedactionPolicy — a reusable set of redactions, built in memory or loaded from XML
  • RedactorChangeLog / RedactionResult — the result of apply(), with a RedactionStatus
  • License, Metered — licensing APIs

Redactions

  • Text: ExactPhraseRedaction, RegexRedaction, CellColumnRedaction, PageAreaRedaction, ReplacementOptions, RegionReplacementOptions
  • Metadata: EraseMetadataRedaction, MetadataSearchRedaction, MetadataFilters
  • Annotations: AnnotationRedaction, DeleteAnnotationRedaction
  • Image / page: ImageAreaRedaction, RemovePageRedaction, PageSeekOrigin

Options & enums

  • LoadOptions, SaveOptions, RasterizationOptions, AdvancedRasterizationOptions, PdfComplianceLevel, RedactorSettings
  • RedactionStatus (APPLIED, PARTIALLY_APPLIED, SKIPPED, FAILED)

Exceptions

  • GroupDocsRedactionException, DocumentFormatException, IncorrectPasswordException, PasswordRequiredException, TrialLimitationsException

Platform Wheels

The release ships as pre-built, self-contained wheels for the following platforms (no separate .NET runtime required):

PlatformWheel
Windows x64groupdocs_redaction_net-26.6.0-py3-none-win_amd64.whl
Linux x64groupdocs_redaction_net-26.6.0-py3-none-manylinux1_x86_64.whl
macOS x64groupdocs_redaction_net-26.6.0-py3-none-macosx_10_14_x86_64.whl
macOS ARM64groupdocs_redaction_net-26.6.0-py3-none-macosx_11_0_arm64.whl

System Requirements

  • Python: 3.5 – 3.14
  • Platforms: Windows x64, Linux x64, macOS x64/ARM64
  • No external software (MS Office / OpenOffice) required. On Linux install libgdiplus, libfontconfig1, and libicu-dev (plus ttf-mscorefonts-installer for fonts); on macOS install mono-libgdiplus via Homebrew.

Evaluation Mode

The API works without a license in evaluation mode, with these limitations:

  • Only one document can be opened per process (a subsequent open raises TrialLimitationsException).
  • Only one redaction can be applied to the document, limited to four replacements/deletions.
  • Trial badges are placed at the top of each page of the output document.

To remove these limitations, apply a license or request a free 30-day temporary license:

from groupdocs.redaction import License

License().set_license("path/to/license.lic")

Or set the environment variable (auto-applied at import):

export GROUPDOCS_LIC_PATH="path/to/license.lic"
Public API changes

No breaking changes. This release tracks the underlying GroupDocs.Redaction engine and refreshes the bundled dependencies for stability and security.

Explore our resources