Skip to content

Instantly share code, notes, and snippets.

View jramirez857's full-sized avatar

Jose Ramirez jramirez857

View GitHub Profile
jramirez857 /
Last active September 14, 2022 01:54
Gist for getting top email senders from your most recent n emails. Requires GMail API Project Setup with credentials in a credentials.json file. Usage 1. python -m venv venv 2. `source venv/bin/activate` 3. `pip install -r requirements.txt` 4. `python -m --help`
This module contains the GmailAuth class. It is used to authenticate with
import argparse
import os.path as p
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials