Last active
August 29, 2015 14:21
-
-
Save grizwako/6a5ab54f1e5d70d3f074 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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