A simple python package for posting messages to slack channels.
Slack webhooks are an easy way to get push notifications on mobile and desktop.
At Foundry Group we are using this package to push news about our portfolio companies to a slack channel dedicated to portfolio company news.
Install with pip:
pip install slackwebhook
First, create a slack webhook to the channel you want, and save the url.
To post a simple update to slack using the url you just generated:
import slackwebhook
mywebhook = slackwebhook("<my webhook url>")
mywebhook.post("Testing simple text post")
To post rich-text posts:
import slackwebhook
mywebhook = slackwebhook("<my webhook url>")
mywebhook.rich_format_post(fallback="Full rich format test", text="Full rich format test", pretext="Checkout this cool thing:", title="Cool Stuff!", value="Here's some more info", short=False, color="#000000")
Thanks to Peter Downs for his awesome tutorial about how to publish to pypi.
© Carl Cortright 2016