report output of command to slack channel
Project description
= slack-report
Report the results of executing the specified command to Slack.
== Use
The basic interface of `slack-report` is the same as `sudo`, `time`, `watch`, _etc._:
slack-report COMMAND
Any executable command, as well as its arguments, are accepted, and executed.
For example:
slack-report --channel=ops --title="uptime report" time annotate ./tps-reports.sh
The above would execute `time` (most likely `/usr/bin/time`), passing it the arguments `annotate ./tps-reports.sh` (such that these would be executed as well). The resulting standard output and error would be uploaded to Slack, and shared in the "ops" channel, with the title: "uptime report."
For the complete interface, consult `slack-report --help`.
== Installation
`slack-report` is available from https://pypi.org/project/slack-report/[PyPI] and https://github.com/dssg/slack-report[GitHub].
To install via `pip`:
pip install slack-report
== Configuration
In addition to its command flags, `slack-report` may be configured via the shell/process environment.
A Slack API token is *required*. This may be provided either via command flag `--token` or environment variable `SLACK_API_TOKEN`.
The API token requires permission:
* to post the results file: `files:write`
* to look up requested channels by name: `channels.read`
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
slack-report-0.0.2.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for slack_report-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5395b66781eca90e2aaeceb24d897d0cf7808f58e4a5caf80d4628458d21f50 |
|
MD5 | e9dfa1097762e79025ad80de424226e3 |
|
BLAKE2b-256 | ab6276d45667ea9af6bbacdcc4d6949c5ad95e12e8884c0fce8a39d93fc7a44d |