异步发现API客户端+身份验证
aiogoogle的Python项目详细描述
aiogoogle
快速启动
列出您的google驱动器文件
importasynciofromaiogoogleimportAiogoogleuser_creds={'access_token':'an_access_token'}asyncdeflist_files():asyncwithAiogoogle(user_creds=user_creds)asaiogoogle:drive_v3=awaitaiogoogle.discover('drive','v3')full_res=awaitaiogoogle.as_user(drive_v3.files.list(),full_res=True)asyncforpageinfull_res:forfileinpage['files']:print(file['name'])asyncio.run(list_files())
使用Trio列出您的google日历事件
$ pip install aiogoogle[trio_asks]
importtriofromaiogoogleimportAiogooglefromaiogoogle.sessions.trio_asks_sessionimportTrioAsksSessionuser_creds={'access_token':'an_access_token'}asyncdeflist_events():asyncwithAiogoogle(user_creds=user_creds,session_factory=TrioAsksSession,)asaiogoogle:calendar_v3=awaitaiogoogle.discover("calendar","v3")events=awaitaiogoogle.as_user(calendar_v3.events.list(calendarId="primary"),full_res=True)asyncforpageinevents:print(page)trio.run(list_events)
使用curio列出YouTube视频
$ pip install aiogoogle[curio_asks]
importcuriofromaiogoogleimportAiogooglefromaiogoogle.sessions.curio_asks_sessionimportCurioAsksSessionuser_creds={'access_token':'an_access_token'}asyncdeflist_playlists():asyncwithAiogoogle(user_creds=user_creds,session_factory=CurioAsksSession,)asaiogoogle:youtube_v3=awaitaiogoogle.discover("youtube","v3")req=youtube_v3.playlists.list(part="snippet",mine=True)res=awaitaiogoogle.as_user(req)print(res)curio.run(list_playlists())
文档
阅读文档:https://aiogoogle.readthedocs.io/en/latest/
设置
$ pip install aiogoogle
联系方式
我目前是一名自由软件开发人员。喜欢我的工作给我找工作?
想全职雇用我吗?给我发邮件@omarryhan@gmail.com
给我买杯咖啡
比特币:3nmywnkr1lzo8gynxfunzvboziacpea31z
以太坊:0x1e1400c311cd813685fe0f6d29e0f91c1da4675ae
比特币现金:qqzn7rsav6hr3zqcp4829s48hvsvjat4zq7j42wkxd
litecoin:mb5m3ce3je4e8nwgcwofjlvgqjdqpyyejp
paypal:https://paypal.me/omarryhan