Python SDK for Getui push service based on asyncio(aiohttp).
Project description
aiogetui
Python SDK for Getui push service based on asyncio(aiohttp). Based on GeTui rest api.
Installation
$ pip install aiogetui
Basic Usage
import asyncio
import uuid
from aiogetui import IGeTui, ToSingleMessage, NotificationTemplate
APP_ID = ''
APP_KEY = ''
MASTER_SECRET = ''
CLIENT_ID = ''
async def run():
client = IGeTui(APP_ID, APP_KEY, MASTER_SECRET)
await client.auth_sign()
message = ToSingleMessage(client_id=CLIENT_ID,
template=NotificationTemplate(
{
'title': 'my title',
'text': 'My text.',
}),
is_offline=True, # optional, default to False
message_id=uuid.uuid4().hex, # optional, length 10~32
)
_result = await client.push(message)
await client.close()
return _result
result = asyncio.get_event_loop().run_until_complete(run())
print(result)
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
aiogetui-0.2.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for aiogetui-0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ff82ef82477c8b0edd9a2388d3cf7a7d8cda8da43ad39b717d8afa23d26bbdf |
|
MD5 | 0a9f214c54cda92179495b6439a5a6be |
|
BLAKE2b-256 | 7d307d20e42acec92197a3514d9ea499b31c105e17ae4aba4deb10c8e1526515 |