Automate Your Data Deletion Rights Under GDPR & CCPA
A local-first, privacy-preserving automation tool that helps you exercise your right to data deletion across hundreds of online services. 100% open source, 100% local - your data never leaves your machine.
- Scans your Gmail inbox for signup/welcome emails
- Automatically extracts company domains
- Privacy-preserving: only reads email headers, never content
- Discovers hundreds of services you've signed up for over the years
- Automated web scraping to find privacy contact emails
- Checks common privacy policy pages (
/privacy,/gdpr,/data-protection) - Pattern matching for
privacy@,dpo@,gdpr@email addresses - 40-70% success rate for automatic discovery
- Manual entry interface for remaining companies
- Three email templates: GDPR (Article 17), CCPA, and Generic
- Batch sending with Gmail API integration
- Automatic rate limiting to avoid spam filters
- Customizable templates with company name substitution
- Professional, legally-informed language
- Monitors email threads for company responses
- Automatic status categorization:
- ✅ COMPLETED: Deletion confirmed
- ⏳ REPLIED: Request acknowledged/in progress
- ❓ PENDING: Awaiting response
- Keyword-based sentiment analysis
- Dashboard showing completion rates
- CLI Mode: Fast, text-based terminal interface for power users
- Desktop GUI: Modern graphical interface with dark/light themes
- Interactive launcher - choose your preferred interface at startup
- 100% Local: All data stored on your machine in PostgreSQL
- Secure Token Storage: OAuth tokens encrypted in OS keychain
- No Telemetry: Zero tracking, no external analytics
- Open Source: Fully auditable codebase
- Privacy-Preserving Scanning: Email headers only, never body content
- Python 3.11+
- PostgreSQL (local installation)
- Gmail Account with API access enabled
- Google Cloud Project with Gmail API enabled
-
Clone the repository
git clone https://github.com/yourusername/privacy-deletion-tool.git cd privacy-deletion-tool -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure database
cp .env.example .env nano .env # Add your PostgreSQL credentials -
Set up Google OAuth
- Create a project in Google Cloud Console
- Enable Gmail API
- Create OAuth 2.0 credentials (Desktop app type)
- Download credentials as JSON
- Save to
config/google_credentials.json
-
Initialize database
python src/database.py
-
Launch the application
python launcher.py
python launcher.pyChoose between CLI or GUI mode, then follow the interactive prompts.
python main.pyWorkflow:
- Add Email Account → Authenticate with Gmail OAuth
- Scan for Companies → Discover services from your inbox
- Find Privacy Contacts → Auto-detect + manual entry
- Send Deletion Requests → Batch email sending
- Check for Replies → Track responses and completion
- View Dashboard → Statistics and progress
python main_gui.pyModern graphical interface with:
- Visual dashboard with statistics cards
- Dark/Light theme support
- Progress tracking with textbox outputs
- Click-through navigation
Your Gmail → Privacy Tool scans headers → Extracts sender domains → Stores in local database
- Uses Gmail API with
gmail.readonlyscope - Optimized query:
from:(-me) AND ("welcome to" OR "verify your email"...) - Fetches only metadata (sender, subject, date)
- Privacy guarantee: Email content is never accessed
Domain list → Web scraper checks privacy pages → Extracts contact emails → Stores with confidence level
- Tries 11 common privacy page paths
- Pattern matches:
privacy@,dpo@,dataprotection@, etc. - Returns confidence level: high/medium/low
- Fallback to common email patterns if not found
Template selection → Generate personalized emails → Send via Gmail API → Log message IDs for tracking
- Professional templates cite GDPR Article 17 / CCPA
- Variable substitution:
{company_name},{user_email},{date} - Stores Gmail
threadIdfor reply tracking - 1-second delay between sends (rate limiting)
Check Gmail threads → Analyze reply content → Categorize by keywords → Update status in database
- Keyword matching:
- "deleted", "removed" → COMPLETED
- "received your request", "processing" → REPLIED
- "verify", "additional information" → VERIFICATION NEEDED
privacy-deletion-tool/
├── launcher.py # Interactive interface launcher
├── main.py # CLI application
├── main_gui.py # Desktop GUI application
├── requirements.txt # Python dependencies
├── .env.example # Database configuration template
├── config/
│ └── google_credentials.json # OAuth credentials (user-provided)
├── src/
│ ├── database.py # PostgreSQL manager
│ ├── logger.py # Logging configuration
│ ├── auth_manager.py # Secure token storage
│ ├── gmail_auth.py # Gmail OAuth 2.0
│ ├── account_manager.py # Account CRUD operations
│ ├── email_scanner.py # Company discovery from emails
│ ├── company_manager.py # Company database management
│ ├── contact_finder.py # Web scraping for privacy contacts
│ ├── manual_contact.py # Interactive manual entry CLI
│ ├── templates.py # Email templates (GDPR/CCPA/Generic)
│ ├── request_sender.py # Gmail API email sender
│ ├── reply_tracker.py # Reply monitoring and categorization
│ └── utils.py # Shared utilities and validators
├── logs/ # Application logs (auto-created)
└── tests/ # Test suite
- PostgreSQL Database: Stores companies, accounts, and request metadata locally
- OS Keychain: OAuth tokens encrypted using your OS's secure storage (Windows Credential Manager, macOS Keychain, Linux Secret Service)
- No Cloud Services: Zero external dependencies for data processing
- Email addresses (yours, companies' privacy contacts)
- Company domains discovered from your inbox
- Request status (sent/replied/completed)
- Email metadata (message IDs, thread IDs, dates)
- ❌ Email body content
- ❌ Personal conversations
- ❌ Passwords or payment information
- ❌ Telemetry or usage analytics
gmail.readonly: Read email headers for company discoverygmail.send: Send deletion request emails
You can revoke access anytime at Google Account Permissions
DB_NAME=privacy_deletion_db
DB_USER=postgres
DB_PASSWORD=your_password_here
DB_HOST=localhost
DB_PORT=5432- Go to Google Cloud Console
- Create a new project
- Enable Gmail API
- Create OAuth 2.0 Client ID
- Application type: Desktop app
- Download JSON credentials
- Save as
config/google_credentials.json
CREATE TABLE accounts (
id SERIAL PRIMARY KEY,
email_address VARCHAR(255) UNIQUE NOT NULL,
service VARCHAR(50) NOT NULL,
added_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE companies (
id SERIAL PRIMARY KEY,
domain VARCHAR(255) UNIQUE NOT NULL,
company_name VARCHAR(255),
privacy_contact VARCHAR(255),
contact_type VARCHAR(50) DEFAULT 'email',
last_verified DATE,
notes TEXT
);CREATE TABLE requests (
id SERIAL PRIMARY KEY,
company_id INTEGER REFERENCES companies(id) ON DELETE CASCADE,
account_id INTEGER REFERENCES accounts(id) ON DELETE CASCADE,
status VARCHAR(50) DEFAULT 'PENDING',
sent_date TIMESTAMP,
sent_message_id TEXT,
reply_received_date TIMESTAMP,
completion_date TIMESTAMP,
notes TEXT
);Run the test suite:
pytest tests/Test individual modules:
python src/email_scanner.py # Test email scanning
python src/contact_finder.py # Test contact finding
python src/utils.py # Test utilitiesContributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
pip install -r requirements.txt
pip install -r requirements-dev.txt # Additional dev dependenciesThis tool helps you exercise your Right to Erasure under Article 17 of the General Data Protection Regulation (GDPR). Companies must comply within 30 days unless they have a legitimate reason to retain your data.
This tool assists with Deletion Requests under the California Consumer Privacy Act (CCPA). Businesses must comply within 45 days (with a possible 45-day extension).
This tool is provided for informational and automation purposes only. It is not legal advice. Companies may reject deletion requests for legitimate reasons (e.g., legal obligations, contract fulfillment, fraud prevention). Always verify company responses and follow up as needed.
MIT License - see LICENSE file for details.
- CustomTkinter: Modern UI framework by Tom Schimansky
- Gmail API: Google's email integration platform
- BeautifulSoup4: Web scraping library
- PostgreSQL: Reliable open-source database
Your Privacy Matters 🔐
Made with ❤️ for a more privacy-respecting internet