Coder Social home page Coder Social logo

chbaker / gmail-cli-handler Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 9 KB

Interact with your gmail account over the command line for quick batch operations. this currently only supports delete functionality by label or sender keyword.

License: MIT License

Python 100.00%
oauth2 pythonscript gmailapi

gmail-cli-handler's Introduction

gmail-cli-handler

Interact with your gmail account over the command line for quick batch operations. this currently only supports delete functionality by label or sender keyword.

Setup

takes roughly 10 minutes

  1. Follow the python quickstart gmail API Docs to create a project, enable the gmail api, and download the credentials.

  2. Rename the downloaded JSON file to credentials.json and copy it to the same directory as email_handler.py

Run The Script

  1. Navigate to the directory you copied the script to.

  2. Run the script and add the input variables: and . Label must be exact, but sender is a keyword search.

  3. Ex: $ python email_handler.py label='work' sender='[email protected]'

  4. The script will open your browser to verify the OAUTH2 with the client and your gmail account.

  5. Follow the command line prompst, the script will always ask before the final deletion of emails.

NOTE

The gmail API does not allow instant and total deletion

This script just moves emails to the trash folder, which is cleared according to your settings

To allow instant and total deletion, you must submit a form to register your api with google, since this can be a security issue/dangerous if not used properly.

Resources

python quickstart gmail API Docs

builder API methods, handles all gmail interactions

gmail API http response types and query params

gmail-cli-handler's People

Contributors

chbaker avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.