Skip to content

Instantly share code, notes, and snippets.

@riyadhalnur
Created November 10, 2016 09:46
Show Gist options
  • Save riyadhalnur/81e8adb8db8483e6adf9c554e218b90f to your computer and use it in GitHub Desktop.
Save riyadhalnur/81e8adb8db8483e6adf9c554e218b90f to your computer and use it in GitHub Desktop.
Retrieve the data from Google Forms that are saved to a Google Spreadsheets file
import gspread
from oauth2client.service_account import ServiceAccountCredentials
SCOPE = ['https://spreadsheets.google.com/feeds']
# The key file can be downloaded from Google Developer Console
KEY = 'yourkey.json'
# Authenticate using your key file
credentials = ServiceAccountCredentials.from_json_keyfile_name(KEY, SCOPE)
gc = gspread.authorize(credentials)
# List all available spreadsheets
gs = gc.openall()
print(gs)
# Open a single spreadsheet
gs = gc.open('Your Uber Form')
worksheet = gs.sheet1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment