python - 使用 Python 从 google 日历 api 获取所有假期的列表
问题描述
我已经勾选了所有要添加到我的谷歌日历的国家。现在,使用 google api,我正在尝试检索所有的假期,每天。
到目前为止,我有:
from __future__ import print_function
from googleapiclient.discovery import build
from google.oauth2.credentials import Credentials
SCOPES = ['https://www.googleapis.com/calendar/v3/calendars/primary/holiday']
creds = Credentials.from_authorized_user_file('token.json', SCOPES)
service = build('calendar', 'v3', credentials=creds)
events = service.events().list(calendarId='primary', timeMin = '2021-01-01T00:00:00Z',
timeMax='2022-01-02T00:00:00Z').execute()
只返回
{'kind': 'calendar#events',
'etag': '"p32kbjd5mnaof20g"',
'summary': 'ncl.rm.business.analysis@gmail.com',
'updated': '2021-06-24T14:15:13.401Z',
'timeZone': 'America/New_York',
'accessRole': 'owner',
'defaultReminders': [{'method': 'popup', 'minutes': 30}],
'nextSyncToken': 'CKi5tLa6sPECEKi5tLa6sPECGAUguITQtQE=',
'items': []}
无论我的事件/范围变量发生什么变化。
解决方案
推荐阅读
- dns - 如何将 BITMAIN Antminer 加入 Microsoft Windows Server 2008 Active Directory
- c# - 在没有管理员权限的情况下运行 taskmgr.exe?
- regex - perl linux文件名验证
- laravel - Laravel 登录什么都不做
- html - 如何在 div 中对齐所有内容?
- java - 无法在 Heroku 部署的应用程序上启用 COAP
- javascript - 为什么我的地图获取当前位置后没有在地图中显示地名?
- java - WSO2 服务器未启动:org.wso2.carbon.server.util.BundleInfoLine.getInstance(BundleInfoLine.java:87)
- javascript - 使用 Dexie.js 编写多个 where 条件
- flutter - Flutter / Dart FutureBuilder:NoSuchMethodError:方法'[]'在null上被调用