Skip to main content

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

  1. Backup — calwash saves a full JSON backup of your events before any changes
  2. Regex pass — scans event summaries, descriptions, and locations for PII patterns with validation (Luhn checksum for credit cards, format checks for SSNs, etc.)
  3. AI pass (if --ai) — sends events to a local LLM to classify context-dependent sensitive content
  4. Redact — replaces matched text with tags like [EMAIL REMOVED] or [SENSITIVE: MEDICAL]
  5. 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.json at ~/.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


Download files

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

Source Distribution

calwash-0.3.2.tar.gz (74.0 kB view details)

Uploaded Source

Built Distribution

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

calwash-0.3.2-py3-none-any.whl (89.8 kB view details)

Uploaded Python 3

File details

Details for the file calwash-0.3.2.tar.gz.

File metadata

  • Download URL: calwash-0.3.2.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

Hashes for calwash-0.3.2.tar.gz
Algorithm Hash digest
SHA256 b802543875b6e2f41859acc3ba0e8e7073076f59d714c7fcc21be66e1e8f9b79
MD5 3c73574a89cefae0ea5c1db2fdbbcffc
BLAKE2b-256 51bcdcbad55593f1265d988ee58ae51ee9977e97ce28011ca4a6bdb5850bfa28

See more details on using hashes here.

File details

Details for the file calwash-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: calwash-0.3.2-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

Hashes for calwash-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 974666ebaf27cf999cef34793d770703bc249fbc1cefd2eaf3368e140b5d1f4c
MD5 b13f9b2c629520839c1735ef795a437d
BLAKE2b-256 cffb42ec1dd79f40d414b87f7601f704243106144d47da3b808808010033df73

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