Skip to main content

Offline document anonymizer for legal teams

Project description

anonymizer

Offline document anonymizer for legal teams. Replaces personally identifiable information (PII) in documents with structured tokens before sending them to external AI services.

Status: MVP-0 release candidate.

What it does

Drag a file (docx / xlsx / pdf, including scanned PDFs when local OCR is available, plus txt / md / csv / html / rtf — RTF downloads as a fresh docx) into the local web UI and get an anonymized document where:

  • Names, companies, financial details, addresses, emails, phones are replaced with structured tokens like [Person_1], [Company_1], [ADDRESS_1], ...
  • Document metadata is cleared
  • No network calls during processing — runs entirely on your machine

Then send the result to your AI tool of choice.

MVP-0 scope

  • Formats: docx, xlsx, pdf with text layer, scanned PDF, hybrid PDF, txt, md, csv, html, and rtf (anonymized copy is delivered as docx)
  • Languages: Russian and English by default; optional Spanish, German, and Italian NER packs; language-agnostic detectors for emails, phones, IBAN, cards, IP/MAC/URL, dates, and geocoordinates
  • Platforms: Windows + macOS
  • UI: local web app at 127.0.0.1 in your browser
  • Install: single curl one-liner → uv tool install docs-anonymizer

Scanned and hybrid PDFs use local Tesseract OCR with English and Russian language packs. Password-protected files, further detection languages, and editable recognized-DOCX export remain planned for later iterations.

Installation

# macOS / Linux
curl -fsSL https://anonymizer.site/install.sh | sh

# Windows (PowerShell)
iwr -useb https://anonymizer.site/install.ps1 | iex

Then run anonymize — your browser will open at http://127.0.0.1:<port>.

OCR setup for scanned PDFs

Scanned and hybrid PDFs require system Tesseract with English and Russian language packs. The anonymizer installer offers to install Tesseract interactively and shows an approximate download/install size before asking. If you skip it, DOCX, XLSX, and PDFs with a text layer still work.

# macOS
brew install tesseract tesseract-lang

# Ubuntu / Debian
sudo apt install tesseract-ocr tesseract-ocr-eng tesseract-ocr-rus

# Windows (PowerShell)
winget install UB-Mannheim.TesseractOCR

On macOS, Homebrew's tesseract-lang package is large because it bundles all extra languages; expect up to roughly 720 MB on disk. Ubuntu/Debian and Windows downloads are usually smaller, and the package manager may show the exact download size.

After installing Tesseract, run:

anonymize doctor --no-network

If OCR is unavailable, scanned PDF processing is rejected with installation guidance instead of silently skipping scanned pages.

For installation problems and other common issues, see docs/troubleshooting.md.

Stack

Python 3.11+, FastAPI + htmx, spaCy + Natasha, PyMuPDF, python-docx, openpyxl, lxml. Full details in the technical spec.

Architecture

Three-layer design — core (headless Python library), cli, webapp (FastAPI on loopback) — plus testkit for synthetic test corpus generation and feedback loop tooling. Detectors are pluggable; language packs are drop-in. Manual masking + audit logging without PII leakage.

Licenses

The project is released under AGPL-3.0 because it depends on PyMuPDF (AGPL). Optional language models retain their upstream licenses; in particular, it_core_news_lg is CC BY-NC-SA 3.0 and is intended for non-commercial use. The source distribution published with each release contains the project source needed to satisfy AGPL source-availability obligations.

A page in the application UI will list all bundled libraries and models with their individual licenses.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docs_anonymizer-0.6.1.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docs_anonymizer-0.6.1-py3-none-any.whl (459.1 kB view details)

Uploaded Python 3

File details

Details for the file docs_anonymizer-0.6.1.tar.gz.

File metadata

  • Download URL: docs_anonymizer-0.6.1.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for docs_anonymizer-0.6.1.tar.gz
Algorithm Hash digest
SHA256 510a6cbfbf3ef3023a5a88439fb8825c6487f299d8a2bea7eb554e6c2e7fc12a
MD5 bf1d4ef575b276ca43609011b80117e0
BLAKE2b-256 87b1bf6bec0f636d4e8222b14f6cad300f5ee4246f75659d0ce7e99795ed4ebf

See more details on using hashes here.

File details

Details for the file docs_anonymizer-0.6.1-py3-none-any.whl.

File metadata

File hashes

Hashes for docs_anonymizer-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1118cba9d8adcdb44c34c0d3bf11e41d435defa317583e536dd5041561e868f
MD5 0b5a417c2913b538007bbfc64d4fe603
BLAKE2b-256 f650bb0b890f1beaab80bd499363fdc26ec6e9b7c4cb276d07dfc6e4f7a9fed9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page