Skip to content

Latest commit

 

History

History
53 lines (32 loc) · 1.82 KB

README.md

File metadata and controls

53 lines (32 loc) · 1.82 KB

This is a little utility to identify the most heavy email senders & offenders in your gmail account. Outputs by ranked frequency the most common senders, domains, and email addresses. Output is intended to help you manually clean up your gmail, unsubscribe, and/or create filters.

I wrote this to identify emails to delete, so there are settings to ignore specific emails that come from senders I like.

One time setup

1. Setup Gmail API Access

Follow steps in "Step 1" of these instructions: https://developers.google.com/gmail/api/quickstart/python#step_1_turn_on_the_api_name

You should have downloaded a client_secret.json file to the same directory as this README.

This will give you permission to access your own gmail. No one else.

2. Setup your python project

  1. Install pipenv

     pip install pipenv
    
  2. Create a python3 venv (it will be created under ~/.virtualenvs/)

     pipenv --three
    
  3. Activate your venv

     pipenv shell
    
  4. Install dependencies, which includes the gmail python client.

     pipenv install
    
  5. Copy config.py.sample to config.py and edit config.py as desired

     cp config.py.sample config.py
    

Run the script

Edit config.py repeatedly as desired and rerun with:

python analyze.py

To speed up testing while you figure out your desired config settings, use a small year range or 1 year batches.

Reference Guides