Skip to content

Instantly share code, notes, and snippets.

@grizwako
Last active August 29, 2015 14:21
Show Gist options
  • Save grizwako/6a5ab54f1e5d70d3f074 to your computer and use it in GitHub Desktop.
Save grizwako/6a5ab54f1e5d70d3f074 to your computer and use it in GitHub Desktop.
email = "blablo"
password = "master"
doc_key = 'z7843ruijfu8rbjdabf34ukbkjfbasdf'
columns = ['08:00', '16:00', 8]
first_day_row = 6
# http://gspread.readthedocs.org/en/latest/oauth2.html
# google ouath lib does not work on win with py3.4?
from datetime import date
import gspread
client = gspread.login(email, password)
doc = client.open_by_key(doc_key)
today = date.today()
m = str(today.month)
if len(m) == 1: m = '0'+m
title = str(today.year)+'-'+m
sheet = doc.worksheet(title)
today_row = first_day_row - 1 + today.day
for j, val in enumerate(columns, 2):
sheet.update_cell(today_row, j, val)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment