-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgSpreadsheetPull.py
More file actions
34 lines (27 loc) · 1.17 KB
/
gSpreadsheetPull.py
File metadata and controls
34 lines (27 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
""" Data Visualization
authors @ coreyacl, allisonbusa, junwonlee5
This file will host the main for the Visualization.
"""
def pullData():
"""
pulls data and stores is into something usable.
"""
import gspread #https://github.com/burnash/gspread
#https://www.twilio.com/blog/2017/02/an-easy-way-to-read-and-write-to-a-google-spreadsheet-in-python.html
from oauth2client.service_account import ServiceAccountCredentials
from pdb import set_trace #set_trace() is godsend. Used for troubleshooting
# use creds to create a client to interact with the Google Drive API
scope = ['https://spreadsheets.google.com/feeds']
creds = ServiceAccountCredentials.from_json_keyfile_name('DataViz.json', scope)
client = gspread.authorize(creds)
# Find a workbook by name and open the first sheet
sh = client.open_by_key('1E6E1iKK38B9JyNcpqK8VpfH9nCMIZzKEyNREv_DTAO0').sheet1
#worksheet = sh.get_worksheet(0)
list_of_hashes = sh.get_all_records()
print(list_of_hashes)
#val = worksheet.cell(1,1).value
#row = worksheet.row_values(1)
#worksheet.update_acell('B6','dogs are cute')
# print(val)
# print(row)
print('Done')