Closed JrtPec closed 9 years ago
As far as I know, there is no email and password in the config but a key that looks like an oauth token. Maybe we already use oauth? @saroele probably knows?
I'm talking about this piece of code from houseprint.py:
pwdfile = file(os.path.join(self.sourcedir, 'og.txt'))
pwd = pwdfile.readlines()[0].rstrip()
# open spreadsheet, store main sheet in self.sheet
self.gc = gspread.login('opengridcc@gmail.com', pwd)
Looks like an email and password to me. Try it in a terminal and you will get the warning.
Yes, we use password login through gspread. Honestly, I have no idea how to set up oauth identification. On the other hand, we may use this occasion to discuss the relevance of the houseprint spreadsheet and consider switching to a different format?
On the short term, oauth authorisation looks like the best solution if we can quickly fix this. So I have to repeat Jan's question: anyone experience with this?
I'm on it. I have already tested it with a personal project of mine and am now implementing it for Open Grid. Expect a working branch in a matter of minutes ;-)
The authorization makes use of json file with keys and such, so we will have to e-mail that around or something.
https://github.com/JrtPec/opengrid/tree/issue_51OAuth2-GSpread
There it is. I have followed the instructions from http://gspread.readthedocs.org/en/latest/oauth2.html so I've needed to enable the Google Drive API for opengridcc@gmail.com, create a credential json and share the houseprint sheet with it.
@saroele I'll e-mail you the json file so you can pass it on to the other devs
Great, I can test it tomorrow and I'll mail the json to all devs. Op 25 apr. 2015 12:42 schreef "Jan Pecinovsky" notifications@github.com:
https://github.com/JrtPec/opengrid/tree/issue_51OAuth2-GSpread
There it is. I have followed the instructions from http://gspread.readthedocs.org/en/latest/oauth2.html so I've needed to enable the Google Drive API for opengridcc@gmail.com, create a credential json and share the houseprint sheet with it.
@saroele https://github.com/saroele I'll e-mail you the json file so you can pass it on to the other devs
— Reply to this email directly or view it on GitHub https://github.com/opengridcc/opengrid/issues/51#issuecomment-96175425.
Jan,
Seems like a neat implementation, cool! I still have to test, but i first need your branch.
The easiest solution is if you make a pull request to the develop branch of opengridcc/opengrid. I can of course add your fork to my remotes but a pull request is more gitty.
I stumbled on this warning while using gspread to fetch metadata from a google spreadsheet (it doesn't show in iPython, but does in the terminal):
Today was april 24, and it still works, but for how long...?
Does anybody have experience with oAuth2 and gspread?