Skip to content

Simple python script for mass deleting of emails on Gmail.

License

Notifications You must be signed in to change notification settings

leonavevor/Gmail-deleter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gmail-deleter

Getting started

This script will help you delete unnecessary emails on gmail. It will provide you with options to delete all emails, emails from certain category and emails from a certain user . It also has additional features for emptying trash, deleting spam emails, getting statistics for email size, or displaying frequency of sent/received emails to/from a certain user.

Prerequisites

  • Python
  • The pip package management tool for Python
  • Access to Internet and a web browser
  • A Google account with Gmail account enabled
  • matplotlib for Python

Turn on Gmail API

Follow the instructions

Installation

  • Optional: Create a virtual environment

  • Run:

    pip install --upgrade google-api-python-client

(Check requirements.txt for additional informations about requirements for installation)

  • Install requirements with constraints (recommended)
  • run pip install -r requirements.txt -c constraints.txt

Usage

  • Copy json file generated from Gmail API to the repository directory

Run script inside src folder with:

python gmail_deleter.py

You can add extra options -s or --secret with a path to your "credentials.json" file.

python gmail_deleter.py -s credentials.json

The script provides the following options:

  • deletion of all messages
  • deletion of all messages from a certain category (i.e. Promotions, Forums, Social...)
  • deletion of all messages from a certain user
  • emptying trash
  • emptying spam

WARNING: All messages will be deleted permanently (not moved to Trash).

About

Simple python script for mass deleting of emails on Gmail.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.3%
  • Shell 6.7%