Python script for Gmail inbox management
Top 68.5% on sourcepulse
This Python script automates Gmail inbox management by filtering promotional emails using OpenAI's GPT-3 or GPT-4 models. It's designed for users with large Gmail inboxes overwhelmed by promotional content, offering a way to declutter and focus on important messages.
How It Works
The script fetches unread emails from a Gmail account via the Gmail API. For each email, it sends the subject and a snippet of the body to an OpenAI model, prompting it to classify the email as promotional or not. Based on the model's response, it can then apply labels or archive the emails.
Quick Start & Requirements
pip install -r requirements.txt
credentials.json
(Google API credentials) and OPENAI_API_KEY
environment variable.python process_all_unread_emails.py
Highlighted Details
Maintenance & Community
No specific community channels or roadmap are mentioned in the README. The project appears to be a single-author script.
Licensing & Compatibility
The README does not specify a license. This may imply a default "all rights reserved" or an unstated permissive license. Compatibility for commercial use or closed-source linking is undetermined without a license.
Limitations & Caveats
The script requires significant setup involving Google Cloud and OpenAI API credentials. It processes only unread emails and does not specify error handling for API rate limits or classification failures. The lack of a specified license poses a risk for commercial adoption.
1 year ago
Inactive