gspread/OAuth2: authenticated default gmail account (used early in ClientLogin)

隐身守侯 提交于 2019-12-13 00:47:39

问题


I have been using gspread (authenticated via ClientLogin) for a last year. Now I would like to use OAuth2. I've followed tutorial from gspread site: http://gspread.readthedocs.org/en/latest/oauth2.html

The problem is that this method creates new "Email address" (in console.developers.google) which doesn't have an access to spreadsheets - all spreadsheets should be shared again. This is really difficult if you have 1000+ spreadsheets.

The question is: how to authenticated with OAuth2 my default gmail account (that I've been using to access via ClientLogin)?

Thank you!

EDIT:

I've followed this tutorial: http://www.indjango.com/access-google-sheets-in-python-using-gspread/

But I modified code from point 1.2: http://www.indjango.com/access-google-sheets-in-python-using-gspread/#comment-2026863410

Result - some spreadsheets are available, some not and I have no idea why (same entries in access list)...


回答1:


It seems that code from EDIT works. Thus, this is working solution:

I've followed this tutorial: http://www.indjango.com/access-google-sheets-in-python-using-gspread/

But I modified code from point 1.2: http://www.indjango.com/access-google-sheets-in-python-using-gspread/#comment-2026863410

The only problem is that Google Sheets API returns only 500 results (thus, if using gspread when you have more spreadsheets that are not among results -> gspread raises SpreadsheetNotFound).



来源:https://stackoverflow.com/questions/30240247/gspread-oauth2-authenticated-default-gmail-account-used-early-in-clientlogin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!