Skip to content

Instantly share code, notes, and snippets.

View yangyxt's full-sized avatar

yxt yangyxt

  • The University of Hong Kong
View GitHub Profile
@vperezb
vperezb / execute_apps_script.py
Last active April 29, 2024 07:46
Execute Google Sheets Macro or Apps Script Programatically using python and Google Apps Script API
'''
Gist from the post https://medium.com/@victor.perez.berruezo/execute-google-apps-script-functions-or-sheets-macros-programmatically-using-python-apps-script-ec8343e29fcd
Code partially from Google Apps Script Quickstart https://developers.google.com/apps-script/api/quickstart/python
'''
import pickle
import os.path
from googleapiclient import errors
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow