diff --git a/docs/oauth2.rst b/docs/oauth2.rst index 386cfdd82..ce74d50ea 100644 --- a/docs/oauth2.rst +++ b/docs/oauth2.rst @@ -61,6 +61,21 @@ Depending on your system setup you may need to install PyOpenSSL: 6. Now you can read this file, and use the data when constructing your credentials: +:: + + import gspread + from oauth2client.service_account import ServiceAccountCredentials + + scope = ['https://spreadsheets.google.com/feeds'] + + credentials = ServiceAccountCredentials.from_json_keyfile_name('gspread-april-2cd … ba4.json', scope) + + gc = gspread.authorize(credentials) + + wks = gc.open("Where is the money Lebowski?").sheet1 + +If using oauth2client < 2.0.0 + :: import json