The Email Digest Generator is a Python-based tool designed to simplify email management. It connects to your email inbox, retrieves recent messages, summarizes their content using AI, and generates a concise daily report. The generated digest is saved as a text file for easy reference.
- Email Fetching: Connects securely to your email inbox using IMAP.
- Content Extraction: Processes emails to extract plain text content, even from multipart messages.
- AI Summarization: Summarizes email content using the open-source Flan-T5 model.
- Daily Digest Creation: Combines email subjects and summaries into a structured report.
- File Saving: Saves the digest as a text file for offline access.
- Fetch Emails: Retrieves recent emails from your inbox.
- Extract Content: Extracts and processes plain text from emails.
- Summarize with AI: Uses Flan-T5 to generate concise summaries.
- Generate a Digest: Combines summaries into a formatted report.
- Save to File: Stores the digest as a text file.
- Python 3.7 or higher
- Install dependencies from
requirements.txt:pip install -r requirements.txt
transformers==4.34.0torch>=1.9.0sentencepiece==0.1.99pytest==7.4.2(for testing)
Set the following environment variables for custom configurations (optional):
IMAP_SERVER(default:imap.gmail.com)IMAP_PORT(default:993)MODEL_NAME(default:google/flan-t5-small)
- Clone the repository.
- Navigate to the project directory.
- Run the tool:
python project.py
- Enter your email credentials when prompted.
- A text file named
daily_digest.txtwill be created in the project directory containing the summarized digest.
The project includes unit tests to ensure all functions work as expected. Run tests with:
pytest test_project.py- This tool is designed for personal email management and does not store credentials.
- Use an app-specific password for secure email access when using providers like Gmail.
This project is open-source and available under the MIT License.
- Hugging Face for the Flan-T5 model.
- Python community for libraries and resources.