pushka

Push notifications, SMS and emails on top of asyncio.

Supported services:

  • Email: Amazon SES
  • SMS: Twilio
  • Push notifications: Parse (deprecated)

Install

The easiest way is install via pip:

pip install pushka

Quickstart

If you are new to asyncio, please read some intro on it first! And here’s a basic example for sending email message via Amazon SES:

import asyncio
import pushka

# NOTE: client uses `SendEmail` method, so user's policy must grant
# `ses:SendEmail` permission.
access_id='***' # Amazon SES access ID
secret_key='***' # Amazon SES secret key

mail_to = ['to@example.com'] # Some email to receive mail
mail_from = 'from@example.com' # Sender's email address

loop = asyncio.get_event_loop()
run = loop.run_until_complete

mailer = AmazonSESService(
    access_id=access_id,
    secret_key=secret_key,
    loop=loop)

run(mailer.send_mail(
        text="Some text",
        subject="Some subject",
        recipients=mail_to,
        sender=mail_from))

Indices and tables