Skip to content

A Python application that automates the organization of your Gmail emails into predefined categories (Passwords and Logins, Online Purchases, Promotions, Personal) using the Google APIs. The application automatically analyzes the content of the emails and applies appropriate labels based on configurable keywords. It also uses AI.

License

Notifications You must be signed in to change notification settings

fdemusso/EmailOrganizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Organizer

A Python application to automatically organize Gmail emails into custom categories. Available in two versions: with and without artificial intelligence.

Python License Gmail API Ollama

📋 Overview

Email Organizer is an application that helps you keep your Gmail inbox automatically organized. It's available in two versions:

🤖 AI Version (Email_IA.py)

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.

📝 Standard Version (Email_NoIA.py)

Uses predefined rules based on keywords to categorize emails. Lighter and faster, ideal for those who prefer more direct control over categorization.

✨ Features

Common to Both Versions

  • Gmail API Integration
  • Custom Label System
  • Flexible Configuration
  • Detailed Logging
  • Docker Support

AI Version Specific

  • AI-based Categorization
  • Continuous Learning
  • Semantic Content Analysis
  • Automatic Category Management

Standard Version Specific

  • Rule-based Categorization
  • Precise Category Control
  • Optimized Performance
  • No External AI Dependencies

🚀 Installation

Prerequisites

  • Python 3.9 or higher
  • Gmail Account
  • Google API Credentials
  • Docker (optional)

Google Cloud Setup

  1. Go to Google Cloud Console
  2. Create a new project
  3. Enable Gmail API
  4. Create OAuth 2.0 credentials
  5. Download the google_credentials.json file

Docker Installation (Recommended)

  1. Clone the repository:
git clone https://github.com/tuousername/email-organizer.git](https://github.com/fdemusso/EmailOrganizer.git
cd email-organizer
  1. Choose the version to use:

    • For AI version: cd IA
    • For Standard version: cd No_IA
  2. Place configuration files:

    • google_credentials.json
    • config.json
  3. Start the application:

docker-compose up --build

Local Installation

  1. Clone the repository:
git clone https://github.com/tuousername/email-organizer.git](https://github.com/fdemusso/EmailOrganizer.git
cd email-organizer
  1. Choose the version to use:

    • For AI version: cd IA
    • For Standard version: cd No_IA
  2. Create a virtual environment:

python -m venv venv
source venv/bin/activate  # Linux/Mac
venv\Scripts\activate     # Windows
  1. Install dependencies:
pip install -r requirements.txt
  1. For AI version, install Ollama:

  2. Place configuration files:

    • google_credentials.json
    • config.json
  3. Run the application:

# For AI version
python Email_IA.py

# For Standard version
python Email_NoIA.py

📁 Project Structure

email-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

⚙️ Configuration

config.json 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
    }
}

📊 Usage

  1. On first run, a browser will open for Google authentication
  2. The application will start processing uncategorized emails
  3. Emails will be automatically categorized and labeled in Gmail

🔍 Version Differences

Feature AI Version Standard Version
Categorization AI-based Predefined rules
Performance Slower Faster
Resources Higher Lower
Flexibility High Medium
Control Low High

🤝 Contributing

Contributions are welcome! Please read the contribution guidelines before submitting a pull request.

📝 License

This project is distributed under the Apache License 2.0. See the LICENSE file for more details.

🙏 Acknowledgments

  • Google for the Gmail API
  • Ollama for the Gemma 3 12B model
  • All project contributors

About

A Python application that automates the organization of your Gmail emails into predefined categories (Passwords and Logins, Online Purchases, Promotions, Personal) using the Google APIs. The application automatically analyzes the content of the emails and applies appropriate labels based on configurable keywords. It also uses AI.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published