ASYNC Google日历API客户端

aiogc的Python项目详细描述


AIOGC

Async Google Calendar API Client for Python 3

安装

在终端中运行此命令:

pip install aiogc

用法

下面的代码将在最近5天内打印即将发生事件的摘要和startend日期时间。

importasyncioimportdatetimeimportaiohttpfromaiogcimportevents,modelsc=models.Credentials(client_id='<your_client_id>',client_secret='<your_client_secret>',scopes=['<your_scope1>','your_scope2'],refresh_token='<your_refresh_token>')asyncdefmain():asyncwithaiohttp.ClientSession()ass:es=awaitevents.list(calendar_id='<your_calendar_id>',credentials=c,session=s,singleEvents='true',timeMin=datetime.datetime.now().isoformat(),timeMax=(datetime.datetime.now()+datetime.timedelta(days=5)).isoformat(),orderBy='startTime',)foreines:print(f'{e.summary}:\n{e.start.dateTime}{e.end.dateTime}')if__name__=='__main__':loop=asyncio.get_event_loop()loop.run_until_complete(main())

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
无生物特征对话框的java Android生物特征认证   Java(Linux)和Windows系统之间的socket字符编码   java在Spring引导应用程序中使用JSF   java在没有类型转换的情况下访问父类型的arraylist中的特定子类型方法,子类型的创建只有在运行时才知道   java死锁线程检查   java Spring引导MySQL不批处理插入   java如何在Android文本视图中显示来自Firebase的消息列表?   Android API 24<与java一起崩溃。lang.NoClassDefFoundError:com。谷歌。常见的基础CharMatcher   如何在Java中修改JSON对象内的值   java解析JAR run命令中所需的参数   java从PRAGMA表_info()获取名称和类型   java如何删除字符串中的重复项,例如:“我的名字是这个和那个这个和那个”输出将是“我的名字是这个和那个”   java在自动连接DAOBean时自动连接类   集合的java通用返回类型   java在不覆盖现有点的情况下向对象添加点