I went from install, to sample code, to hacking spreadsheets in about 35 seconds. It was so easy.
Easy_Install the Module
- Open up a console and browse to my Python\scripts folder
- Run easy_install (setup instructions for easy_Install) like so: easy_install gspread
- Easy Install does all the heavy lifting.
Create a Spreadsheet
Create a spreadsheet in Google Drive and call it whatever you want. Remember the name because you will need it for your sample script.
Sample Script
You will see some sample scripts on the GitHub project page. Here is my script.
It really is that simple. You just setup your username and password. The module will then will convert that to an Oauth session for you to authenticate to Google securely. We open the spreadsheet with the gc.open("Pythontest").sheet1 command.
You can see the update command is commented out: wks.update_acell('B2',"some data here"). You can fetch a range of cells and print out the values. You can retrieve whole columns or rows.
This module is awesome and so easy to use.
0 comments:
Post a Comment