Skip to main content

Slack Events API adapter for Python with FastAPI

SlackEventManager is a Python-based solution to recieve and parse events from Slack's Events API

This is simple add to fastapi server SLack Events API

Installation

pip install fastapi-slackeventsapi

Work Setup

Usage

Create simple FastAPI app and add SlackEventManager event handler

import os

import uvicorn
from fastapi import FastAPI
from fastapi_slackeventsapi import SlackEventManager

signing_secret = os.environ.get('SLACK_BOT_SIGNING_SECRET')

app = FastAPI()

slack_event_manger = SlackEventManager(singing_secret=signing_secret,
                                       endpoint='/slack/events/',
                                       app=app)


@slack_event_manger.on('reaction_added')
async def reaction_added(event_data):
    emoji = event_data['event']['reaction']
    print(emoji)


uvicorn.run(app, host='0.0.0.0')

Metadata

Release files for fastapi-slackeventsapi 0.1.0

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

Source distribution (sdist)

Source distribution for fastapi-slackeventsapi 0.1.0
File Size Uploaded
fastapi_slackeventsapi-0.1.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-slackeventsapi 0.1.0
File Interpreter ABI Platform
fastapi_slackeventsapi-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / fastapi_slackeventsapi-0.1.0.tar.gz

Download URL fastapi_slackeventsapi-0.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d2ef06eace9ca309c8413f7eaaad181c15b453a36d6e7ce262df813c402e4fa8
BLAKE2b-256 checksum
How to use checksums
9671d87d715ecff671de12643ec37ccdd0e33bf2d2a1d881cf0c8a244c0619ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.2 Linux/5.4.0-1043-azure

Release files / fastapi_slackeventsapi-0.1.0-py3-none-any.whl

Download URL fastapi_slackeventsapi-0.1.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d805b5482ec074644f1fb85eca57129d176175e1abcb8bc9fd78a06479ea56f
BLAKE2b-256 checksum
How to use checksums
ae59dd14eb6d613a2bd1f8c2ab919086aa8e9177a4b31d7b0e3b1fcd5a3208df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.2 Linux/5.4.0-1043-azure

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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