What You Can Do with GroupDocs.Redaction for Python via .NET

Find and Remove Private Text in EXCEL Files with Python

Use Python and GroupDocs.Redaction for Python via .NET to clear sensitive details from your EXCEL documents. Whether it’s for work or personal use, your content stays safe.

How to Redact Text in Excel Files

With GroupDocs.Redaction for Python via .NET in your Python via .NET projects, you can easily remove or hide private content.

  1. Create a Redactor and open your Excel file.
  2. Choose your redaction settings.
  3. Enter the text you want to search and what to replace it with.
  4. Run the redaction and save your updated file.
import groupdocs.redaction as gr
import groupdocs.redaction.redactions as grr

# How to redact text in a EXCEL file

# Set up your redaction options
# Choose the text to search and what to replace it with
repl_opt = grr.ReplacementOptions("[redacted]")
        
redaction = grr.ExactPhraseRedaction("Text to hide", repl_opt)

# Open your file with the Redactor constructor
with gr.Redactor("input.xslx") as redactor:

    # Apply the redactions and save your new EXCEL file
    result = redactor.apply(redaction)
    redactor.save()
pip install groupdocs-redaction-net
click to copy
copied
More examples Documentation

More Redaction Features

GroupDocs.Redaction for Python via .NET helps you clear sensitive content across many file formats. Keep your documents safe and shareable.

Redaction tools in action

Replace private text

Search and replace any matching text. Works with smart search and regex patterns.

Cover image content

Hide parts of images with overlays. Customize how it looks on the page.

Remove hidden details

Erase metadata like author info, comments, and timestamps.

Redact Patterns with Regex

Use regex to find and clean text patterns like emails, phone numbers, or account details.

Python

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

# Define your EMAIL regex pattern and replacement text
repl_opt = grr.ReplacementOptions(color)
emailRegex = "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}"

redaction = grr.RegexRedaction(emailRegex, repl_opt)

# Open the file you need to clean
with gr.Redactor("source.xslx") as redactor:

    # Apply redaction rules
    result = redactor.apply(redaction)

    # Save the final version of the file
    so = gro.SaveOptions()
    so.add_suffix = True
    so.rasterize_to_pdf = False
    result_path = redactor.save(so)
pip install groupdocs-redaction-net
click to copy
copied
More examples Documentation

Meet GroupDocs.Redaction for Python via .NET

GroupDocs.Redaction for Python via .NET gives Python developers everything they need to clean up EXCEL files. Remove text, images, comments, and metadata with simple code.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Redaction for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Redact Content in EXCEL Using Python

Use Python to remove private text from EXCEL files. Make sure your content is safe to store or share.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English