slack_webhooks

Incoming Webhook helper for Slack


License
Other
Install
pip install slack_webhooks==1.0.6

Documentation

slack-webhooks

Easily integrate Slack webhooks with your project.

Examples

Send a message

from slack_webhooks import SlackWebhook, SlackAttachment

webhook = SlackWebhook('https://hooks.slack.com/services/foo/bar/baz'
                       icon_emoji=':panda:')
webhook.send('Cool beans!')

Supports Attachments

attachment = SlackAttachment('Party Time!', text='Party Time',
                             title='What time is it?', color='good')
webhook.send('Cool beans!', attachment=attachment)

Decorate a function

a2 = SlackAttachment('Oh no!', text='Nooooo',
                      title='Bad things?', color='danger')
@webhook.decorate('woo', boo', success_attachment=attachment,
                  failure_attachment=a2)
def do_stuff(foo):
    print foo