I use the following to access bouth Google Drive and Google Sheets in my Google Colab Notebook:
# Mount Google Drive
from google.colab import drive
drive.mount('/content/drive')
# Google Sheets
from google.colab import auth
auth.authenticate_user()
import gspread
from google.auth import default
creds, _ = default()
gc = gspread.authorize(creds)
from gspread_dataframe import get_as_dataframe, set_with_dataframe
My problem with this is that it asks for the user to confirm the authentication in a pop-up and I want to use colabctl (https://github.com/bitnom/colabctl) to automate the execution of some scripts, so I need to execute the authentication part without user interaction.



