Local privacy classifier and redactor for sensitive files (emails, text, markdown, PDFs)
Project description
dispose
Local privacy classifier and redactor for sensitive files — text, markdown, email (.eml), and PDF.
Built for scrubbing iCloud / personal email exports before you feed them to an AI agent. Sensitive spans are replaced with [REDACTED]. Nothing is sent to OpenAI or any other network service.
Source: codeberg.org/hiddendispatches/dispose
Install
Requires Python 3.9+.
pip install dispose
Then:
dispose --version
dispose categories
From source (contributors)
git clone https://codeberg.org/hiddendispatches/dispose.git
cd dispose
pip install -e ".[dev]"
pytest
Eight privacy categories
Same taxonomy as OpenAI Privacy Filter (without using their model or tool):
| Category | What gets redacted |
|---|---|
account_number |
SSNs, credit cards (Luhn), bank accounts, routing numbers, IBANs, labeled account / member / policy IDs |
private_address |
Street addresses, city/state/ZIP, PO boxes |
private_email |
Email addresses |
private_person |
Names in email headers, salutations, signatures |
private_phone |
Phone numbers |
private_url |
URLs and IP addresses (including iCloud / share links) |
private_date |
Dates, especially DOB-labeled dates |
secret |
Passwords, API keys, tokens, JWTs, PEM private keys |
Classifiers are deterministic pattern engines tuned for high recall on structured PII in correspondence. They run entirely offline.
Usage
# List the eight categories
dispose categories
# Read an .eml: decode base64 / quoted-printable so you can actually read it
dispose view path/to/mail.eml
dispose decode path/to/mail.eml # alias for view
dispose view mail.eml --pager # open in less/more
dispose view mail.eml -o readable.txt # save decoded text
# Read decoded content AND redact privacy spans
dispose view mail.eml --redact
dispose view mail.eml --redact -o clean.txt
# Classify a file (report spans, do not write)
dispose classify path/to/email.eml
dispose classify ./exports --recursive --json
# Redact → writes path.redacted.ext by default
dispose redact path/to/notes.md
dispose redact ./icloud-export --recursive
# Print redacted text to stdout (pipe into an agent)
dispose redact message.eml --stdout
# Pipe / stdin
cat message.eml | dispose view -
cat message.eml | dispose redact -
# Overwrite in place (careful)
dispose redact sensitive.txt --in-place
# Only certain categories
dispose redact mail.eml -c private_email -c private_phone -c account_number
# Labeled placeholders: [REDACTED:private_email]
dispose redact mail.eml --label-categories
# OpenAI Privacy Filter-style alias
dispose filter mail.eml --stdout
Supported inputs
- Text / markdown:
.txt,.md,.markdown,.rst,.log, … - Email:
.eml(MIME-parsed into headers + body by default; base64 and quoted-printable transfer encodings are decoded before redaction, including multipart bodies, nested messages, text attachments, and RFC 2047 headers) - Structured text:
.csv,.json,.yaml,.html, … - PDF:
.pdf(text is extracted, redacted, and written as a clean text PDF or plain text if you choose a non-.pdfoutput path)
Library use
from dispose import PrivacyPipeline
pipeline = PrivacyPipeline()
result = pipeline.redact(open("mail.eml").read())
print(result.redacted)
print(result.summary())
for span in result.spans:
print(span.category, span.text, span.score)
Safety notes
disposeis a data minimization aid, not a legal anonymization guarantee.- Pattern classifiers can miss novel formats and can over-redact lookalikes.
- Review high-sensitivity outputs before sharing, even with an AI agent you trust.
- Prefer
--stdoutor a separate output directory over--in-placeuntil you trust the result.
Releasing (maintainers)
Version lives only in pyproject.toml. Tag on Codeberg matches that version:
# after bumping version in pyproject.toml
git tag -a v0.1.0 -m "dispose 0.1.0"
git push origin main --tags
pip install -e ".[dev]"
pytest
python -m build
python -m twine check dist/*
# TestPyPI, then PyPI (API token; username __token__)
twine upload --repository testpypi dist/*
twine upload dist/*
PyPI does not require GitHub; Codeberg is the source host. Publish with a PyPI API token + twine (Trusted Publishing from Codeberg is not available yet).
License
MIT — see LICENSE.
Contributions
If you found this package useful, please consider donating or supporting development as a solo founder I've been without gainful employment for years.
Donations
SOL AH7TXdVn2ZddT7DALxSQz97AJBvweBXZdvV5vAojqgBy
ZEC BNB Chain 0xF7fE0DD3165053bD87217BF3e09041e123736175
TON/GRAM UQAnfI9jJj1iI5nxRcc0jXjrFtg41Ik7XvskB77mLNNMKwwK
Dev Studio https://6-castles.xyz
Support dispose-dev AT beconfidential DOT co
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dispose-0.1.0.tar.gz.
File metadata
- Download URL: dispose-0.1.0.tar.gz
- Upload date:
- Size: 27.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e42664b809d14859a0d3c0b91c86c52e563e136c37dbcc721b1b2d38252dfea
|
|
| MD5 |
84ec93a58620767c116ef0d96326ca89
|
|
| BLAKE2b-256 |
e57f20717aa577309ff3bf360c49f23f933aff4e5e1353a3517fe02c9f52046c
|
File details
Details for the file dispose-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dispose-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c2f0a99a1cace81fcd84f5e3aa864147f37f1b79f549a7c0a11857eb160e366
|
|
| MD5 |
e740f58ab77f932203f6e2a843d21d38
|
|
| BLAKE2b-256 |
76609ee648a0fa50b40f264f62fa7f20f8c9653b3f8a06873e4bb80c06468e72
|