Anonimizador de PDF
Streamlit app that detects personal data in PDFs (CPF, CNPJ, phones, emails, addresses) with regex + spaCy NER and redacts it.
Overview
Anonimizador is a data-protection tool: upload a PDF, see everything sensitive that was found (with a human in the loop), and download the version with black bars. It combines fast regex rules (CPF, CNPJ, phone, email, CEP, credit card) with a Portuguese spaCy NER model for people, organizations, and places.

Features
- Detection — 6 regex patterns plus spaCy NER (
pt_core_news_lg) for PER/ORG/LOC. - Review before redacting — each finding is shown as a checkbox; only checked items get anonymized.
- Redaction — PyMuPDF
add_redact_annot+apply_redactions, so the data is physically removed from the file. - Runs fully offline — no API keys, no cloud.
Tech stack
- Python 3.10+, managed with uv
- Streamlit for the UI
- spaCy (
pt_core_news_lg) for named-entity recognition - PyMuPDF (fitz) for PDF handling
Running locally
uv sync
uv run python -m spacy download pt_core_news_lg
uv run streamlit run app.py
Why this project?
It’s a practical take on the LGPD/data-protection problem in Brazil: combining rule-based and ML-based detection, and making the tool safe by requiring human confirmation before anything is redacted.