Async Google Calendar API Client
Project description
aiogc
Async Google Calendar API Client for Python 3
Installation
Run this in your terminal:
pip install aiogc
Usage
Following code prints summary and start
and end
datetimes of upcoming events within nearest 5 days.
import asyncio
import datetime
import aiohttp
from aiogc import events, models
c = models.Credentials(
client_id='<your_client_id>',
client_secret='<your_client_secret>',
scopes=['<your_scope1>', 'your_scope2'],
refresh_token='<your_refresh_token>'
)
async def main():
async with aiohttp.ClientSession() as s:
es = await events.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',
)
for e in es:
print(f'{e.summary}:\n{e.start.dateTime} – {e.end.dateTime}')
if __name__=='__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiogc-0.1.5.tar.gz
(3.8 kB
view details)
Built Distribution
aiogc-0.1.5-py3-none-any.whl
(6.0 kB
view details)
File details
Details for the file aiogc-0.1.5.tar.gz
.
File metadata
- Download URL: aiogc-0.1.5.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed3f817c06cc643069713e129e5aaf37ba667a1f9c1174c2dd5c90ac38e53b15 |
|
MD5 | 214c081d6d8e468671bb40c445441c34 |
|
BLAKE2b-256 | d8bf5b1723e738de1312ae432f85350672210d4db03644fb95ea3dfd0ade5cef |
File details
Details for the file aiogc-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: aiogc-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6caa7ec35e25245cb07c663c73d6f609fe931764979f754b9cf5eec0dd02b1b1 |
|
MD5 | 1de304f1a84f03205dd0d0d6374bdd1d |
|
BLAKE2b-256 | 3c6b38553c4a953e13ab330eb69b42d330ad81462cf0f469b927d46a387c8058 |