如果我在Google Calender中写了一些活动 例如:3到4个事件我如何启动python程序以使用Google API提取所有这些事件?
event = service.events().get(calendarId='primary', eventId='eventId').execute()
print event['summary']
答案 0 :(得分:0)
步骤1。您需要日历ID。
步骤2。您需要Google凭据。这将启用Google Calendar API的功能
#this code you can use at google app engine
def get_service():
from googleapiclient.discovery import build
from oauth2client.client import GoogleCredentials
credentials = GoogleCredentials.get_application_default()
service = build('calendar', 'v3', credentials=credentials)
return service
step3然后调用事件列表功能
service = get_service()
events = service.events().list(calendarId='calendarId').execute()
引用https://developers.google.com/calendar/v3/reference/events/list