Skip to main content

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)
    print(result)
    await client.close()

asyncio.get_event_loop().run_until_complete(run())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aiogetui, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size aiogetui-0.4-py2.py3-none-any.whl (6.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size aiogetui-0.4.tar.gz (5.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page