Skip to main content

Wrapper for slack_sdk

Project description

slack_webhook

This is a simple wrapper over the slack_sdk for sending messages into a specific slack channel.

Prerequisite

In order to send messages using incoming webhook into slack, an Application must be configured. This needs to be done from a slack account with administrator rights. This is done on a per slack channel basis.

Request an incoming webhook from the administrator with the name of an existing channel for receiving the alerts.

An unique URL will be generated by the administrator.

Note that there is no authentication mechanism. Anyone (script) with knowledge of this URL will be able to generate messages into this channel.

Following is a (fake) sample of such an URL:

https://hooks.slack.com/services/T02TQT999/B01PZ5XXXXX/GevkYac4s55lE97fXXXXXXX

Installation

pip install slack-webhook-alpa

Usage

from slack_webhook import SlackWebhook, SlackWebhookException

url = 'https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXX'

slack_alert = SlackWebhook(url)
slack_alert.send('TEST TEST TEST')

TODO

  • support for fancy formatting of message

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

slack-webhook-alpa-0.0.2.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

slack_webhook_alpa-0.0.2-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

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