Skip to content

Instantly share code, notes, and snippets.

@hamawata
hamawata / get_gmail_api_tokens.py
Last active April 7, 2021 11:54
get gmail api tokens
from __future__ import print_function
import os.path
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
# If modifying these scopes, delete the file token.json.
SCOPES = ['https://www.googleapis.com/auth/gmail.send']
def main():