Skip to main content

Xavier: An AWS Lambda Python Bot Framework

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

Example

import os
import logging
import sys

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

xavier = Brain(env=env)
register_brain(xavier_bot)

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

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


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


@background_queue.task(schedule=['aaa'])
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)

Metadata

Release files for xavier 0.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xavier 0.0.12
File Size Uploaded Provenance
xavier-0.0.12.tar.gz 8.8 kB Without provenance Details

Release files / xavier-0.0.12.tar.gz

Download URL xavier-0.0.12.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
10d8349914ac21eb62388eed07d2756794f07b84fdfe5007f05964cf0065a3ef
BLAKE2b-256 checksum
How to use checksums
c08b13c86a96a3ff27ab24557b6fca3596c3a86654c6ff6df6949641264c904c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for xavier 0.0.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page