Skip to content

Instantly share code, notes, and snippets.

View meetsohail's full-sized avatar
💻
Focusing

Sohail Ahmed meetsohail

💻
Focusing
View GitHub Profile
@hpiwowar
hpiwowar / google_sheets_from_heroku.py
Last active February 5, 2023 19:22
read and write to a google spreadsheet from heroku using python
import os
import json
import gspread
from oauth2client.service_account import ServiceAccountCredentials
# based on https://www.twilio.com/blog/2017/02/an-easy-way-to-read-and-write-to-a-google-spreadsheet-in-python.html
# read that file for how to generate the creds and how to use gspread to read and write to the spreadsheet
# use creds to create a client to interact with the Google Drive API
scopes = ['https://spreadsheets.google.com/feeds']