Repository navigation
Expand file tree
/
Copy pathllms.txt
More file actions
56 lines (41 loc) · 3.06 KB
/
Copy pathllms.txt
File metadata and controls
56 lines (41 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# GroupDocs.Redaction for Python via .NET - examples
> On-premise SDK examples. Permanent redaction of sensitive data in 40+ formats: PDF, Word, Excel, PowerPoint, OpenDocument, images, HTML, Markdown and text.
Python SDK that removes private content for good: text by exact phrase or regular expression, text in scans through the OCR engine of your choice, metadata, comments, image and page areas, and whole pages. It saves the result in the document's own format or as a rasterized PDF from which nothing can be recovered.
## Key Features
- Text redaction by exact phrase (case-sensitive or not) or regular expression, replaced with text or covered with a colored box
- Text in scans and embedded images through an OCR connector, such as one built on Tesseract
- Metadata, comment and annotation redaction; image areas, page areas, and page removal
- Redaction policies, a callback that approves or rejects each match, a logger, and page previews
- Rasterized PDF output, with PDF/A compliance
- Python 3.5 to 3.14 (the examples use f-strings and need 3.6+); Windows, Linux and macOS, in Docker; no Office needed
## Install
```bash
pip install groupdocs-redaction-net
```
pip also installs `groupdocs-shared-net`, which every GroupDocs Python package shares. Without access to PyPI, download the wheel for your platform and the shared wheel from https://releases.groupdocs.com/redaction/python-net/ and install both files:
```bash
pip install ./groupdocs_redaction_net-26.11.0-py3-none-win_amd64.whl ./groupdocs_shared_net-26.11.0-py3-none-any.whl
```
## Code Snippet
```python
from groupdocs.redaction import Redactor
from groupdocs.redaction.options import SaveOptions
from groupdocs.redaction.options.drawing import Color
from groupdocs.redaction.redactions import ExactPhraseRedaction, ReplacementOptions
# Cover every "Emily Johnson" with a red box and save the result as a rasterized PDF
with Redactor("sample.docx") as redactor:
redactor.apply(ExactPhraseRedaction("Emily Johnson", ReplacementOptions(Color.from_argb(128, 255, 0, 0))))
redactor.save(SaveOptions(rasterize_to_pdf=True, add_suffix=True))
```
## AI Search Tags
`python redaction`, `redact pdf python`, `redact word document python`, `remove pii python`, `gdpr redaction python`, `remove metadata python`, `redact text in scanned images python`, `ocr redaction python`, `rasterized pdf python`, `groupdocs redaction sdk`, `on-premise document redaction python`
## Docs & Links
- Docs: https://docs.groupdocs.com/redaction/python-net/
- Formats: https://docs.groupdocs.com/redaction/python-net/supported-document-formats/
- PyPI: https://pypi.org/project/groupdocs-redaction-net/
- API reference: https://reference.groupdocs.com/redaction/python-net/
- Releases: https://releases.groupdocs.com/redaction/python-net/
- Agent guide: AGENTS.md (also shipped in the wheel as groupdocs/redaction/AGENTS.md)
- Full docs as text: https://docs.groupdocs.com/redaction/python-net/llms-full.txt
- Code: https://github.com/groupdocs-redaction/GroupDocs.Redaction-for-Python-via-.NET
- MCP (link only): docs server https://docs.groupdocs.com/mcp