Skip to main content

Asynchronous library for Yandex Dialogs (Alice) API

Project description

aioAlice

AsyncIO library for Yandex Alice (Yandex Dialogs)

Why?

  • Work with classes, don't bother parsing JSON
  • Auto answer to webhook even if you were not fast enough to create answer - there won't be a server error, but you'll get a log

Auto response will not help if you are not using async IO. So consider not to use any long processing synchronous tasks inside handlers

  • Handy handlers to match incoming commands
  • Finite-State Machine
  • Easy images upload, easy answers generation

Installation

# make sure you use virtual env and python 3.6+:
python3.6 -m venv aliceenv
source ./aliceenv/bin/activate

pip install pip -U
pip install setuptools -U
pip install uvloop  # uvloop if you want

pip install aioalice -U
# Or install from GitHub:
# pip install git+https://github.com/surik00/aioalice.git -U

# or if you don't have git installed:
# 1. download ZIP
# 2. unarchive and go to dir
# 3. run:
python setup.py install

Quick start

Hello alice

dp = Dispatcher()

@dp.request_handler()
async def handle_all_requests(alice_request):
    return alice_request.response('Hello world!')

Cards

JSON serializing

If you want to use a faster json library, install rapidjson or ujson, it will be detected and used automatically

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
aioAlice-1.2.1-py3-none-any.whl (26.3 kB) Copy SHA256 hash SHA256 Wheel py3
aioAlice-1.2.1.tar.gz (18.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page