-
-
Save garymanley/c23728f14950a65bdef8c46597ebcbba to your computer and use it in GitHub Desktop.
Google Sheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Sun Jan 7 06:21:03 2018 | |
@author: garym | |
""" | |
### imports | |
import gspread | |
from oauth2client.service_account import ServiceAccountCredentials | |
import pandas as pd | |
# 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(r'C:\Users\garym\Documents\python\client_secret.json', scope) | |
client = gspread.authorize(creds) | |
# Open the workbook | |
sht = client.open('HandicapRelayNY2017') | |
# Get sheet 4 (0,1,2,3) | |
sheet = sht.get_worksheet(3) | |
# Get all the record and put into a pandas dataframe | |
list_of_values = sheet.get_all_records() | |
df = pd.DataFrame(list_of_values) | |
print(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment