Skip to content

Instantly share code, notes, and snippets.

@ashumkin
ashumkin / gsheets.py
Created November 29, 2017 14:01 — forked from xflr6/gsheets.py
Download all sheets of a Google Docs spreadsheet and export to individual CSV files
# gsheets.py - download all sheets of a google docs spreadsheet as csv
import os, csv, itertools, contextlib
from apiclient.discovery import build # pip install google-api-python-client
SHEET = '1dR13B3Wi_KJGUJQ0BZa2frLAVxhZnbz0hpwCcWSvb20'
def get_credentials(scopes, secrets='~/client_secrets.json', storage='~/storage.json'):
from oauth2client import file, client, tools