Welcome to jarjar’s documentation!¶
Jarjar is a python utility that makes it easy to send slack notifications to your teams. You can import it as a python module or use our command line tool.
What Can Jarjar Do For Me?¶
Jarjar was developed at the Austerweil Lab at UW-Madison as a tool for scientists. We use it for all sorts of things, such as:
Sending a message so that we know when long-running processes have finished.
Sending notices when scheduled tasks have failed.
Sending out daily positive vibes.
Quickstart¶
Install¶
Installation is simple!
pip install jarjar
My guess is that you’ll want to create jarjar’s config file, ~/.jarjar
. This tells jarjar
what you’d like to use as a default for your slack team’s webhook, the channel to post to,
and the message it sends. Don’t worry, you can over-ride these anytime.
Edit this snippet and add it to ~/.jarjar
:
channel='@username'
message='Custom message'
webhook='https://hooks.slack.com/services/your/teams/webhook'
If you don’t know your team’s webhook, you might have to make one.
Python API¶
Use the jarjar python api like:
from jarjar import jarjar
# initialize a jarjar object
jj = jarjar() # defaults from .jarjar
jj = jarjar(channel='#channel', webhook='slack-webhook-url')
jj = jarjar(webhook='slack-webhook-url')
# send a text message
jj.text('Hi!')
jj.text('Hi!', channel=["@jeffzemla", "#channel"])
# send an attachment
jj.attach({'meesa': 'jarjar binks'}), text='Hello!')
Command Line Tool¶
We also made a command line tool for use outside of python scripts. The command line tool adds functionality to execute processes and send messages when they are complete.
jarjar sleep 1 -m 'Meesa took a nap!'
And then in your slack team:
Custom attachments are not supported in the CLT at this time, but everything else is:
jarjar -m 'Meesa jarjar binks!' jarjar -m 'Hi, everyone!!' --webhook '<your-url>' -c '#general'