slack-webhook is a python client library for slack api Incoming Webhooks on Python 3.5 and above.
Project description
slack-webhook
slack-webhook is a python client library for slack api Incoming Webhooks on Python 3.5 and above.
Installation
$ pip install slack-webhook
Usage
#
# basic
#
from slack_webhook import Slack
slack = Slack(url='https://hooks.slack.com/services/T00/B00/XXX')
slack.post(text="Hello, world.")
#
# advanced
#
from slack_webhook import Slack
slack = Slack(url='https://hooks.slack.com/services/T00/B00/XXX')
slack.post(text="Robert DeSoto added a new task",
attachments = [{
"fallback": "Plan a vacation",
"author_name": "Owner: rdesoto",
"title": "Plan a vacation",
"text": "I've been working too hard, it's time for a break.",
"actions": [
{
"name": "action",
"type": "button",
"text": "Complete this task",
"style": "",
"value": "complete"
},
{
"name": "tags_list",
"type": "select",
"text": "Add a tag...",
"data_source": "static",
"options": [
{
"text": "Launch Blocking",
"value": "launch-blocking"
},
{
"text": "Enhancement",
"value": "enhancement"
},
{
"text": "Bug",
"value": "bug"
}
]
}
]
}]
)
Getting started
For help getting started with Incoming Webhooks, view our online documentation.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
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-1.0.2.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for slack_webhook-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 883bf4de855f123d44b66e1531faaa552f31c3f464e473a2e2ce6df148490c0e |
|
MD5 | 25be30b97c505fec65287f8fa9023772 |
|
BLAKE2b-256 | d92741c0ac695fb1d2cea2275e96cdba599b4c521ef219c2db7b5d7953c4b83a |