Redact sensitive data from your calendar events
Project description
calwash
Redact sensitive data from your calendar events. Detect and remove PII (phone numbers, emails, SSNs, credit cards), medical terms, legal references, and more — with optional local AI detection that never sends your data to the cloud.
Install
pipx install calwash
Or with pip:
pip install calwash
Quick Start
# 1. Log in to your Google account (opens browser)
calwash login
# 2. Preview what would be redacted
calwash clean --dry-run
# 3. Apply redactions (creates backup first)
calwash clean
What It Detects
Regex (always on):
| Pattern | Example | Replaced with |
|---|---|---|
| Email addresses | john@example.com |
[EMAIL REMOVED] |
| Phone numbers | 555-123-4567 |
[PHONE REMOVED] |
| Social Security Numbers | 123-45-6789 |
[SSN REMOVED] |
| Credit card numbers | 4111-1111-1111-1111 |
[CARD REMOVED] |
| URLs | https://zoom.us/j/123 |
[URL REMOVED] |
| Medical terms | Dr. appointment at clinic |
Private |
AI detection (opt-in, local only):
| Category | Example |
|---|---|
| Medical | "Picking up lithium prescription" |
| Legal | "Meeting with divorce lawyer" |
| Financial | "Salary negotiation with HR" |
| Substance use | "AA meeting at St. Mark's Church" |
| Career | "Interview at Google" (optional) |
| Relationship | "Couples counseling" (optional) |
| Political | "Campaign fundraiser" (optional) |
| Religious | "Prayer group meeting" (optional) |
CLI Reference
Core Commands
calwash login # Authenticate with Google
calwash clean --dry-run # Preview redactions
calwash clean # Apply redactions (backs up first)
calwash restore --dry-run # Preview restore from backup
calwash restore # Restore events from backup
calwash accounts # List saved accounts
Date Filtering
calwash clean --dry-run --days-back 30 # Last 30 days
calwash clean --dry-run --from-date 2025-01-01 --to-date 2025-12-31
calwash clean --dry-run --year 2024 # All of 2024
calwash clean --dry-run --month 2025-08 # August 2025
calwash clean --dry-run --from-date today --to-date next-month
Redaction Levels
calwash clean --dry-run --redaction-level coarse # Replace entire event content
calwash clean --dry-run --redaction-level medium # Replace only matched patterns (default)
Multiple Accounts
calwash login --account work # Add a second Google account
calwash clean --dry-run --account work # Use the work account
calwash accounts # List all accounts
Multiple Providers
calwash login # Google (default)
calwash login --provider apple # Apple iCloud (requires calwash[caldav])
calwash clean --dry-run --provider apple
Install Apple Calendar support:
pipx install calwash[caldav]
AI Detection
calwash can use a local LLM via ollama to catch sensitive content that regex patterns miss — things like "AA meeting" or "meeting with divorce lawyer" that don't contain obvious PII but are still private.
All AI processing happens locally. Your calendar data never leaves your machine.
Setup
# Interactive setup — installs ollama + downloads a model
calwash ai setup
# Or set up manually
brew install ollama # macOS
ollama serve # Start the server
ollama pull phi4-mini # Download a model (2.5 GB)
Usage
calwash clean --dry-run --ai # Use default model
calwash clean --dry-run --ai --ai-model phi4-mini # Choose model
calwash clean --dry-run --ai --ai-categories medical,legal,substance_use
Recommended Models
| Model | Size | Notes |
|---|---|---|
| phi4-mini | 2.5 GB | Fast, good accuracy (recommended) |
| llama3.2 | 2.0 GB | Lightweight default |
| llama3.1 | 4.7 GB | Best accuracy |
| gemma3n | 5.6 GB | Google, efficient on-device |
| nemotron-mini | 4.7 GB | Nvidia, strong reasoning |
Any ollama-compatible model works: calwash clean --dry-run --ai --ai-model <name>
AI Management
calwash ai setup # Guided setup (install + model + test)
calwash ai setup --model llama3.1 # Install a specific model
calwash ai status # Check ollama + model readiness
calwash ai models # List recommended models with sizes
How It Works
- Backup — calwash saves a full JSON backup of your events before any changes
- Regex pass — scans event summaries, descriptions, and locations for PII patterns with validation (Luhn checksum for credit cards, format checks for SSNs, etc.)
- AI pass (if
--ai) — sends events to a local LLM to classify context-dependent sensitive content - Redact — replaces matched text with tags like
[EMAIL REMOVED]or[SENSITIVE: MEDICAL] - Update — pushes cleaned events back to your calendar (or shows a dry-run preview)
Dry-Run Output
CLEANING PREVIEW
============================================================
User: you@gmail.com
Total events that would be modified: 96
Event 1:
Date: 2024-01-03T11:15:00-05:00
Description:
Original: Contact: john@example.com, Phone: 555-123-4567
Would change to: Contact: [EMAIL REMOVED], Phone: [PHONE REMOVED]
Privacy
- No cloud APIs for detection — regex runs locally, AI runs on your machine via ollama
- Google OAuth is used only to access your calendar (read + write events)
- Bundled OAuth credentials — calwash ships with a Google OAuth client ID for convenience. You can use your own by placing
credentials.jsonat~/.calwash/credentials.json - Tokens stored locally at
~/.calwash/accounts/
Data Storage
~/.calwash/
accounts/
default/
token.pickle # Google OAuth token
email.txt # Cached email address
work/
token.pickle
credentials.json # Optional: your own OAuth client ID
Requirements
- Python 3.12+
- Google account (for Google Calendar)
- ollama (optional, for AI detection)
License
MIT
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 calwash-0.3.1.tar.gz.
File metadata
- Download URL: calwash-0.3.1.tar.gz
- Upload date:
- Size: 74.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
971e5eec94cc10158c83f7b2282aef4892c0d2c591b6b65b1ccc484f753356d2
|
|
| MD5 |
470b0d8725070f3e1ac4106877fa2e7e
|
|
| BLAKE2b-256 |
fc03d2c554d14367fb50d7e2a2f1d9afad885126e9a815baf643f00a71807b5c
|
File details
Details for the file calwash-0.3.1-py3-none-any.whl.
File metadata
- Download URL: calwash-0.3.1-py3-none-any.whl
- Upload date:
- Size: 89.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0397d7d3aff87f8a49235bbcd14733f6bfef0e951e07a5585f154c7f348e1c31
|
|
| MD5 |
597765e675e93104ca9d5a19690b8256
|
|
| BLAKE2b-256 |
9dd05f833966fa0e90f0f08f66f54d9ef0afc126140149efd288642b71531de3
|