A Python application to automatically organize Gmail emails into custom categories. Available in two versions: with and without artificial intelligence.
Email Organizer is an application that helps you keep your Gmail inbox automatically organized. It's available in two versions:
Uses artificial intelligence (Gemma 3 12B model from Ollama) to analyze email content and categorize it intelligently. Ideal for those who want more sophisticated and adaptive categorization.
Uses predefined rules based on keywords to categorize emails. Lighter and faster, ideal for those who prefer more direct control over categorization.
- Gmail API Integration
- Custom Label System
- Flexible Configuration
- Detailed Logging
- Docker Support
- AI-based Categorization
- Continuous Learning
- Semantic Content Analysis
- Automatic Category Management
- Rule-based Categorization
- Precise Category Control
- Optimized Performance
- No External AI Dependencies
- Python 3.9 or higher
- Gmail Account
- Google API Credentials
- Docker (optional)
- Go to Google Cloud Console
- Create a new project
- Enable Gmail API
- Create OAuth 2.0 credentials
- Download the
google_credentials.jsonfile
- Clone the repository:
git clone https://github.com/tuousername/email-organizer.git](https://github.com/fdemusso/EmailOrganizer.git
cd email-organizer-
Choose the version to use:
- For AI version:
cd IA - For Standard version:
cd No_IA
- For AI version:
-
Place configuration files:
google_credentials.jsonconfig.json
-
Start the application:
docker-compose up --build- Clone the repository:
git clone https://github.com/tuousername/email-organizer.git](https://github.com/fdemusso/EmailOrganizer.git
cd email-organizer-
Choose the version to use:
- For AI version:
cd IA - For Standard version:
cd No_IA
- For AI version:
-
Create a virtual environment:
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows- Install dependencies:
pip install -r requirements.txt-
For AI version, install Ollama:
- Follow instructions at ollama.com
-
Place configuration files:
google_credentials.jsonconfig.json
-
Run the application:
# For AI version
python Email_IA.py
# For Standard version
python Email_NoIA.pyemail-organizer/
├── IA/ # AI Version
│ ├── Email_IA.py
│ ├── categories.json
│ ├── requirements.txt
│ ├── Dockerfile
│ ├── docker-compose.yml
│ └── README.md
│
├── No_IA/ # Standard Version
│ ├── Email_NoIA.py
│ ├── requirements.txt
│ ├── config.json
│ ├── Dockerfile
│ ├── docker-compose.yml
│ └── README.md
│
└── README.md # This file
{
"Security": {
"description": "Emails related to security, authentication, passwords, access and data protection",
"created_at": "2025-05-19T18:25:04.671596"
},
"Marketing": {
"description": "Marketing emails, newsletters, promotions, special offers and commercial communications",
"created_at": "2025-05-19T18:25:15.478355"
},
"settings": {
"max_emails_to_process": 50,
"check_body": true,
"body_extract_length": 1000
}
}- On first run, a browser will open for Google authentication
- The application will start processing uncategorized emails
- Emails will be automatically categorized and labeled in Gmail
| Feature | AI Version | Standard Version |
|---|---|---|
| Categorization | AI-based | Predefined rules |
| Performance | Slower | Faster |
| Resources | Higher | Lower |
| Flexibility | High | Medium |
| Control | Low | High |
Contributions are welcome! Please read the contribution guidelines before submitting a pull request.
This project is distributed under the Apache License 2.0. See the LICENSE file for more details.
- Google for the Gmail API
- Ollama for the Gemma 3 12B model
- All project contributors