gspread lib: https://github.com/burnash/gspread
# encoding: utf-8
from __future__ import print_function
from __future__ import unicode_literals
import os
import json
import boto3
import logging
import gspread
from oauth2client.service_account import ServiceAccountCredentials
boto3.set_stream_logger('boto3.resources', logging.CRITICAL)
logger = logging.getLogger()
logger.setLevel(os.environ['LOG_LEVEL'])
def lambda_handler(event, context):
# authorization
scope = ['https://spreadsheets.google.com/feeds']
credentials = ServiceAccountCredentials\
.from_json_keyfile_name('Entry Form Project-42962e70a030.json', scope)
gc = gspread.authorize(credentials)
spreadsheet = gc.open("Buyer Progress")
cur_worksheet = spreadsheet.worksheet("アライアンス一覧")
# get all values
list_of_lists = cur_worksheet.get_all_values()