AI-Powered Email Management with Google Sheets Control
“The only thing worse than a funny bone is an ugly inbox.”
Fourteen years with Gmail taught me that Google’s filters are equivalent to using a butter knife when I need onions chopped. Same sender, new address? Still slips through. Unsubscribe link? A placebo. Labels? You're stuck making your own. I finally snapped and developed a script that does three things Gmail still won’t: it bulk-deletes every message from anyone who ever spammed me, spots the same sender even when they swap addresses, and pops up a yes/no on each label so I can dump the dead weight.
I call it Gmail Organiser. If your inbox feels like a storage unit you’re afraid to open, it can be yours too.
I'm not a coder by trade - my background covers Business and Political Science. Having recently learned the basics of Python, this is my first real project. A disclaimer: I'm not a computing expert, nor am I a product developer. This is simply a personal experiment to solve a problem for myself and others who prefer a clean Gmail inbox without having to manage it manually.
This is my first real dive into vibecoding, which allowed me to bridge what I envisioned with my lack of technical expertise. So if any experienced software/product developers are looking at this, I'd really appreciate your feedback!
Built with Streamlit, Google Gmail API, and Google Sheets API.
gmail-organiser/
├── app/ # Main application code
│ ├── app.py # Streamlit user interface
│ ├── auth.py # Google OAuth authentication
│ ├── gmail_client.py # Gmail API operations
│ └── sheets_client.py # Google Sheets API operations
├── core/ # Core business logic
│ ├── scan_senders.py # Scans inbox, groups by sender
│ ├── apply_senders.py # Applies decisions to Gmail
│ ├── classify_senders.py # Keyword classification
│ └── ai_classifier.py # AI classification (optional)
├── config/ # Configuration files
│ └── config.template.yaml
├── docs/ # Documentation
├── .gitignore
├── README.md
├── requirements.txt
└── run_app.bat # Double-click to launch (Windows)
- AI Classification - Automatically categorises emails by sender (Promotions, Social, Updates, Personal, etc.)
- Incremental Scanning - Only scans new emails after the first run
- Google Sheets Control - Make decisions in a spreadsheet, apply them to Gmail
- Safety First - Starred emails and Primary inbox are always protected
- Lifetime Delete Counter - Tracks how many emails you've trashed per sender
Before running, you'll need:
- Google Cloud Project with Gmail API and Google Sheets API enabled
- OAuth credentials.json (download from Google Cloud Console)
- HuggingFace Token (optional - for AI classification, works without it)
- Google Sheet (create one and share with your Gmail)
git clone https://github.com/ArjuKu/Gmail-Organiser.git
cd Gmail-Organiserpip install -r requirements.txt- Copy
config/config.template.yamltoconfig/config.yaml - Fill in your details:
user_email: Your Gmail addresstoken: Your HuggingFace token (optional)spreadsheet_id: Your Google Sheet ID (from the URL)
- Go to Google Cloud Console
- Create a project → Enable Gmail API & Google Sheets API
- Create OAuth credentials → Download as
credentials.json - Place
credentials.jsonin the project folder
python -m streamlit run app/app.pyOr double-click run_app.bat (Windows)
- Scan - Click "Scan Inbox" to analyse your emails
- Review - Check the Google Sheet, make decisions (Keep, Label, Trash)
- Apply - Click "Apply Decisions" to execute your choices
- Python - Core logic
- Streamlit - User interface
- Google APIs - Gmail & Sheets integration
- Keyword Classification - Works without AI (lightweight mode)
This tool modifies your Gmail account. Use with caution. Always review decisions in the Google Sheet before applying.
MIT License - Feel free to use and modify!