Python desktop tool for anonymizing engineering drawing PDFs on macOS.
- Performs true PDF redaction with PyMuPDF (
add_redact_annot+apply_redactions) - Removes content inside redaction regions for text, images, and vector graphics
- Supports batch processing from GUI or CLI
- Writes outputs to
_prodc/by default - Prevents accidental overwrite of the input file (uses
*_redacted.pdfwhen needed)
The GUI now exposes only these three options:
default_autotemplateAtemplateB
default_auto is built in (no JSON file required).
templateA and templateB map to Template A and Template B JSON files.
For each page, the engine combines:
- Fixed template regions (
regions) - Regex-based text matches (
text_patterns) - Optional auto-detection (
auto_detect)- keyword word-matching (
keywords) - corner image scan with area safety cap
- corner vector scan with area safety cap
- keyword word-matching (
Then it applies true redaction and saves with cleanup flags (garbage=4, clean=True).
- macOS
- Python 3.10+
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtOptional drag-and-drop support:
- Install
tkinterdnd2(already listed inrequirements.txt) - If unavailable, the app still works via
Add PDFs
python3 app.pyWorkflow:
- Select template (
default_auto,templateA, ortemplateB) - Add one or more PDF files
- Click
Process - Check outputs in
_prodc/(or your selected output folder)
python3 app.py --cli \
--input /path/a.pdf /path/b.pdf \
--template /Users/shuzishuai/reduction/templates/templateA.json \
--output-dir /path/_prodcNotes:
- If
--templateis omitted in CLI, built-indefault_autois used - If
--output-diris omitted, output goes to each source file's sibling_prodc/
If GUI launch fails with No module named '_tkinter', install Tk support:
brew install python-tk@3.13
deactivate # if venv is active
rm -rf .venv
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtIn Acrobat Pro:
- Open processed PDF
- Use
Select All Objects - Verify sensitive regions have no recoverable selectable objects
app.py: GUI + CLI entryredaction_engine.py: core redaction enginetemplates/templateA.json: Template Atemplates/templateB.json: Template Brequirements.txt: dependencies