GroupDocs.Redaction allows to redact data of sensitive or private nature from your XLS, XLSX, ODS spreadsheet document formats and others. See full list at supported document formats article.
Redact spreadsheet content
fromgroupdocs.redactionimportRedactorfromgroupdocs.redaction.optionsimportSaveOptionsfromgroupdocs.redaction.redactionsimportExactPhraseRedaction,ReplacementOptionsdefredact_spreadsheet_content():# Specify the redaction optionsrepl_opt=ReplacementOptions("-redacted-")ex_red=ExactPhraseRedaction("John Doe",repl_opt)# Load the spreadsheet to be redactedwithRedactor("./sample.xlsx")asredactor:# Apply the redactionresult=redactor.apply(ex_red)# Save the redacted document next to the source fileso=SaveOptions()so.add_suffix=Trueso.rasterize_to_pdf=Falseso.redacted_file_suffix="redacted"redactor.save(so)if__name__=="__main__":redact_spreadsheet_content()
sample.xlsx is the sample file used in this example. Click here to download it.