Skip to main content

Local privacy classifier and redactor for sensitive files (emails, text, markdown, PDFs)

Project description

dispose

logo

Local privacy classifier and redactor for sensitive files — text, markdown, email, and PDF. Built for scrubbing personal inbox exports before you feed them to an AI agent.

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-.pdf output 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

  • dispose is 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 --stdout or a separate output directory over --in-place until you trust the result.

License

MIT — see LICENSE.

Contributions

MIT license and free forever; if it's useful to you, help me eat.

Donations

SOL AH7TXdVn2ZddT7DALxSQz97AJBvweBXZdvV5vAojqgBy
ZEC BNB Chain 0xF7fE0DD3165053bD87217BF3e09041e123736175
TON/GRAM UQAnfI9jJj1iI5nxRcc0jXjrFtg41Ik7XvskB77mLNNMKwwK

Development Studio https://6-castles.xyz

Support dispose-dev AT beconfidential DOT co

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

dispose-0.1.1.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

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

dispose-0.1.1-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file dispose-0.1.1.tar.gz.

File metadata

  • Download URL: dispose-0.1.1.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dispose-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e86a0ca504f611afd7cf5cd5af5411e378ae220fe5c93498e5a04f63e3a3098b
MD5 2d23d85e7c726d458fe3e4a1475ffae3
BLAKE2b-256 75fb6cfc4eab9dfad0ed2678f638e385c99a87167ad39f7a8514017840226043

See more details on using hashes here.

File details

Details for the file dispose-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dispose-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dispose-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f36348c36fda94da0e955e80d42f76f6cc6b937ba412a24dd2c114384e895336
MD5 4ed7aa8847b50c29a2445192290ffae4
BLAKE2b-256 1f17654e5ee1e4fbe9771ad3b1a892986ac4eb52caf427b54b142ebb8d4bfde5

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