有一个公共的Google日历,我有它的日历ID。我想设置一个开始和结束日期,然后在一个CSV文件中获取这些日期之间的所有事件。在Python中最有效的方法是什么?
我找到的最接近的解决方案是https://stackoverflow.com/a/27213635/1936752,它产生一个json文件,没有按日期过滤。我可以用json文件做这件事,写一些代码只过滤我想要的日期,然后导出到csv,但我想有一个更聪明的方法?
我想要的手动方式是使用“导出日历”功能下载ics文件,然后使用像https://openicsfile.com/csv-convert.html这样的ics到csv转换。然后我可以轻松地过滤我想要的日期。我希望使用Python脚本来完成这一操作。
1条答案
按热度按时间wr98u20j1#
我相信你的目标如下。
在这种情况下,下面的示例脚本如何?
示例脚本:
在此示例脚本中,事件列表是使用"Events: list" of Calendar API和API密钥检索的。因此,请检索您的API密钥。请在API控制台启用日历API。
并且,请设置以下示例脚本的变量。
参考: