Read and Write Google Spreadsheets with Python

Using gspread:

import gspread

# Login with your Google account
gc = gspread.authorize(OAuth2Credentials)
# OAuth2Credentials must be an object with a valid access_token attribute,
# such as one created with the oauth2client library:
# http://gspread.readthedocs.org/en/latest/oauth2.html

# Open a worksheet from spreadsheet with one shot
wks = gc.open("Where is the money Lebowski?").sheet1

wks.update_acell('B2', "it's down there somewhere, let me take another look.")

# Fetch a cell range
cell_list = wks.range('A1:B7')

Comments