Skip to content

shiftout/inbox-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inbox-analysis

A lightweight macOS tool that gives you a quick summary of what's happening across all your email inboxes — without touching any APIs, storing credentials, or sending data anywhere.

The idea

Most people have email spread across multiple providers and accounts: a work Outlook, a personal Gmail, a private ProtonMail. Getting a unified picture of what landed in the last 7 days normally means switching between tabs manually.

This tool reads directly from whichever inbox tabs you already have open in Safari or Chrome, scrapes the visible email list, and prints a clean terminal report: unread counts, top senders, high-priority items, and meeting invites — per account, per browser.

How it works

  1. You open your inbox tabs in Safari and/or Chrome and sign in as usual
  2. You run the script
  3. The tool uses AppleScript to inject JavaScript into each open tab
  4. The JavaScript reads the visible email list from the page DOM (no network calls)
  5. Results are parsed, filtered to the last 7 days (or today), and printed

Nothing is stored. Nothing is sent anywhere. It works entirely on your machine using what's already rendered in the browser.

Supported providers and browsers

Provider Works in
Outlook (personal + corporate) Safari, Chrome
ProtonMail Safari, Chrome
Gmail Safari, Chrome

Setup

Requirements: macOS · Python 3.10+

pip install -r requirements.txt

Safari users: enable Develop → Allow JavaScript from Apple Events in Safari's menu bar (one-time setting).

Chrome users: no extra setup needed.

Usage

# Summarize all inboxes, last 7 days
python3 inbox_analyzer.py

# Just today
python3 inbox_analyzer.py --today

# One provider only
python3 inbox_analyzer.py --gmail
python3 inbox_analyzer.py --outlook
python3 inbox_analyzer.py --protonmail

# One browser only
python3 inbox_analyzer.py --safari
python3 inbox_analyzer.py --chrome

# Mix and match
python3 inbox_analyzer.py --gmail --chrome --today

The script auto-detects which browsers are running and which inbox tabs are open. If a provider isn't open in a browser, it's silently skipped.

Example output

┌─────────────────────────────┐
│ Account                     │
│ Safari · Outlook Corporate  │
└─────────────────────────────┘
  Total received     69
  Unread             55
  With attachments    3
  High priority      21
  Meeting invites     4

  Top Senders
  1  SH-SERA                    5
  2  Microsoft 365 Message center 3
  ...

Project structure

inbox_analyzer.py       # entry point and CLI
analysis.py             # date parsing, filtering, stats, terminal report
extractors/
  outlook.py            # Outlook Web Access scraper
  protonmail.py         # ProtonMail scraper
  gmail.py              # Gmail scraper
  base.py               # EmailExtractor abstract base class
  browsers/
    safari.py           # AppleScript bridge for Safari
    chrome.py           # AppleScript bridge for Google Chrome
    base.py             # Browser abstract base class

Extending

New browser: subclass extractors.browsers.base.Browser, implement is_running(), find_tabs(), and run_js(), add it to available_browsers() in extractors/browsers/__init__.py.

New provider: subclass extractors.base.EmailExtractor, implement find_tabs() and scrape_tab(), register it in extractors/__init__.py.

About

Multi-provider inbox analyzer for macOS — scrapes Outlook, ProtonMail and Gmail from open browser tabs via AppleScript. No API keys needed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages