slack_webhook
This is a simple python API for sending messages into a specific slack channel using incoming webhook.
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')
Content formatted in block kit is also supported.
blocks = [
{
"type": "header",
"text": {
"text": "\ud83d\udd34 This is a header",
"type": "plain_text",
"emoji": true
}
}
]
slack_alert.send('TEST TEST TEST', blocks=blocks)
References
Metadata
Release files for slack-webhook-alpa 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| slack-webhook-alpa-0.0.6.tar.gz | 3.0 kB | Without provenance | Details for slack-webhook-alpa-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| slack_webhook_alpa-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for slack_webhook_alpa-0.0.6-py3-none-any.whl |
Total release size: 7.3 kB
Release files / slack-webhook-alpa-0.0.6.tar.gz
| Download URL | slack-webhook-alpa-0.0.6.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e2854e63388c2427d4a1b60719af5b6b773bc6072aff5bc43999d6417ca8012
|
|
BLAKE2b-256 checksum How to use checksums |
1ee202aeb4c2a139f958bb29439a1d062801e6bf313d41d4517b79def7f3755d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7
|
Release files / slack_webhook_alpa-0.0.6-py3-none-any.whl
| Download URL | slack_webhook_alpa-0.0.6-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d0af38f180d100e4951f0a1955e8610397c0f01c695e933fa2e17cb4d3ae37f5
|
|
BLAKE2b-256 checksum How to use checksums |
57ccb12c22e0ec16b32aff728978383882641613e2e994f88f79d3c45e6e4122
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.7
|
Security for slack-webhook-alpa 0.0.6
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.