Skip to main content

FastAPI Implementation of slackeventsapi

Project description

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')

Project details


Download files

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

Source Distribution

fastapi_slackeventsapi-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

fastapi_slackeventsapi-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_slackeventsapi-0.1.0.tar.gz.

File metadata

  • Download URL: fastapi_slackeventsapi-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.2 Linux/5.4.0-1043-azure

File hashes

Hashes for fastapi_slackeventsapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d2ef06eace9ca309c8413f7eaaad181c15b453a36d6e7ce262df813c402e4fa8
MD5 bc0437865a6df155674cd14967d4a1cb
BLAKE2b-256 9671d87d715ecff671de12643ec37ccdd0e33bf2d2a1d881cf0c8a244c0619ae

See more details on using hashes here.

File details

Details for the file fastapi_slackeventsapi-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_slackeventsapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d805b5482ec074644f1fb85eca57129d176175e1abcb8bc9fd78a06479ea56f
MD5 a7860539a5823387fdf59e106a6118c5
BLAKE2b-256 ae59dd14eb6d613a2bd1f8c2ab919086aa8e9177a4b31d7b0e3b1fcd5a3208df

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page