Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

Lambda bot

Project Description

Xavier is a bot framework. Specially built to operate on AWS Lambda.


import os
import logging
import sys

from import register_brain
from xavier.brain import Brain
from import build_lambda_router
from xavier.slack.slash import SlashCommandEvent
from xavier.http import Response, Router
from xavier.offline import BackgroundQueue
from import publish_sns_message, handle_sns_message, handle_sns_schedule

xavier = Brain(env=env)

background_queue = BackgroundQueue(publish_sns_message('arn:background_task'))
router = Router()

def offline_find(slash_command):
    if slash_command.text == 'Hi':
        slash_command.respond({'text': "Howdy"})
                slash_command.respond({'text': "Hi"})

@router.add_route("/slack/commands/hello", methods=['POST'])
def handle_find(request):
    slash_command = SlashCommandEvent.from_request(request)
    return Response(204, "")

def offline_cron(slash_command):

lambda_schedule_hander = handle_sns_schedule(background_queue.process_schedule)
lambda_sns_handler = handle_sns_messages(background_queue.process_event)
lambda_http_handler = build_lambda_router(router)

Release History

This version
History Node


History Node


History Node


History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(7.8 kB) Copy SHA256 Hash SHA256
Source May 15, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting