lwc:google_api:python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

lwc:google_api:python [2020/11/26 17:51] – created John Harrisonlwc:google_api:python [2020/11/27 20:15] (current) John Harrison
Line 1: Line 1:
-**Welcome to [[https://github.com/burnash/gspread|gspread]] adventures:\\ +**Welcome to [[https://github.com/burnash/gspread|gspread]] adventures:
-\\ +
-**+
  
-**setup:\\ +**setup:**
-**+
   * in some setup directory git clone https:%%//%%github.com/burnash/gspread.git   * in some setup directory git clone https:%%//%%github.com/burnash/gspread.git
   * install: sudo python setup.py install   * install: sudo python setup.py install
   * install oath2client:  sudo pip install --upgrade oauth2client   * install oath2client:  sudo pip install --upgrade oauth2client
-  * generate/get json credentials\\ +  * generate/get json credentials 
- +  * add in .bashrc: export GOOGLE_APPLICATION_CREDENTIALS="/path/to.json"
-  * add in .bashrc: export GOOGLE_APPLICATION_CREDENTIALS="/path/to.json"\\ +
- +
  
 You will get a "spreadsheet not found" error unless you share the sheet with the client email from your credentials. Just look at the json file and find the client email. Then share the sheet with that email.\\ You will get a "spreadsheet not found" error unless you share the sheet with the client email from your credentials. Just look at the json file and find the client email. Then share the sheet with that email.\\
  
- +Creating the credentials:
-\\ +
-Creating the credentials:\\ +
   * [[http://gspread.readthedocs.org/en/latest/oauth2.html|Google directions]]   * [[http://gspread.readthedocs.org/en/latest/oauth2.html|Google directions]]
-  * I created an app engine, having no idea which engine to pick. There's a compute engine. No answers found quickly on Google regarding the difference.\\+  * I created an app engine, having no idea which engine to pick. There's a compute engine. No answers found quickly on Google regarding the difference.
  
  
-One option for credentials with gspread:\\+One option for credentials with gspread:
  
 from oauth2client.client import GoogleCredentials credentials = GoogleCredentials.get_application_default() credentials = credentials.create_scoped(['https:%%//%%spreadsheets.google.com/feeds'])\\ from oauth2client.client import GoogleCredentials credentials = GoogleCredentials.get_application_default() credentials = credentials.create_scoped(['https:%%//%%spreadsheets.google.com/feeds'])\\
 gs = gspread.authorize(credentials)\\ gs = gspread.authorize(credentials)\\
-sheet = gs.open('file').worksheet('sheet')\\ +sheet = gs.open('file').worksheet('sheet')
-\\+
  
  
Line 41: Line 31:
  
 Using the latest Gspread (0.6.2) on 14.04 Using the latest Gspread (0.6.2) on 14.04
- 
-\\ 
- 
  
 Update requests: Update requests:
  
-<HTML><blockquote> 
 <code> <code>
  apt-add-repository "deb http://us.archive.ubuntu.com/ubuntu/ yakkety main"  apt-add-repository "deb http://us.archive.ubuntu.com/ubuntu/ yakkety main"
Line 55: Line 41:
  apt-get update  apt-get update
 </code> </code>
-<code> 
- 
-</code> 
-</blockquote></HTML> 
- 
- 
  • lwc/google_api/python.1606434711.txt.gz
  • Last modified: 2020/11/26 17:51
  • by John Harrison