Skip to content

khosbilegt/email-triager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Triager Script

Personal script to run a triage on new emails and a Powershell script to add to Windows Task Scheduler to make it automatic.

Uses a local Ollama model to determine whether the email is important, and if it's not important, marks it as read in your stead.

Context

Experimented with Openclaw with local Ollama models and it was horrible for my device's specs. Had already made up a task to use it for so just ended up making it a python script.

Setup (Brief)

  1. Clone this repository.
  2. Install Python 3.9+.
  3. Install dependencies:
    uv pip install -r requirements.txt
  4. Download your Gmail API credentials as credentials.json from Google Cloud Console.
  5. Run the script once to complete authentication:
    python main.py
  6. (Optional) Use run_triage.ps1 with Windows Task Scheduler for automation. Note to change the global file paths.

Example Output

PS C:\Users\arche\Development\email-triager> uv run .\main.py
Found 50 emails to read.

=== Reading email 19d33d2264338245 ===
Email 19d33d2264338245 classified as IMPORTANT because The email is from a self-proclaimed unicorn, indicating a significant level of personalization and potentially, importance..

=== Reading email 19d2fef27e54999f ===
Email 19d2fef27e54999f classified as NOT important.
Email 19d2fef27e54999f marked as read (not important).

=== Reading email 19d2fc14d0ceab42 ===
Email 19d2fc14d0ceab42 classified as IMPORTANT because The email is from a self-proclaimed unicorn (@AI Startup) and is related to a LinkedIn Pulse article on the opportunity of building a future for everyone. Therefore, it is an important email..

About

Python script to run a triage on new emails and mark them read if unimportant.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors