SlackOps
Post process information to the slack without clogging up the channel with a bunch of messages. Easily update status, see when operation started / finished and how much time it took.
Installation
$ pip install slackops
Table of contents
Basic usage
import slackops
slack = slackops.Operation(token=SLACK_BOT_TOKEN, channel=CHANNEL_NAME)
slack.start("Application update", "Backup")
slack.update("2. Updating application")
slack.update("3. Healthchecks")
slack.finish("4. Application successfully updated!")
Operation statuses also posted to thread:
Simple message
Note: any formatting you see in 'Message' template (header, text, context), can also be used with 'Operation' template you seen before.
slack = slackops.Message(token=SLACK_BOT_TOKEN, channel=CHANNEL_NAME)
slack.post(
text="Example message",
severity="error", # info | success | warning | error
header="Header",
context=["from ip: 192.162.1.1"],
)
Formatting. Default and persistent values
You can set default values:
slack.tmpl.default.set(context=["default context - from ip: 192.162.1.1"])
slack.tmpl.default.set(severity="success")
slack.post("If no value is passed, the default value will be used (if available).")
And persistent values:
slack.tmpl.persistent.set(header="API event: ")
slack.tmpl.persistent.set(text="*Details:*\n")
slack.post("username: haru\n ", header="new user!")
AWS Lambda
To use 'Operation' template beetwen different lamdas, you can do following:
- Export in first lambda:
packed_operation = slack.pack()
- And import in second lambda:
slack = slackops.Operation(packed_operation=packed_operation)
Metadata
Release files for slackops 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| slackops-0.1.7.tar.gz | 5.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| slackops-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.8 kB
Release files / slackops-0.1.7.tar.gz
| Download URL | slackops-0.1.7.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf148bcebb3174c0b78bfa2fd733cf5c1902b554852802d180755675d41b0239
|
|
BLAKE2b-256 checksum How to use checksums |
a6a6e7091cf8aa4e2c425cd2f931496b09f3073b240657953af672ba52eb5dfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.9.16 Linux/5.15.0-1033-azure
|
Release files / slackops-0.1.7-py3-none-any.whl
| Download URL | slackops-0.1.7-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d5cde807312a87976f4564361ddae825f746c2d11236f879cc9b36cfe1ab4f8e
|
|
BLAKE2b-256 checksum How to use checksums |
fddebe3af75b30b6754d25c1934dd258b8e48629ecb506bdcfced12bcac99284
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.9.16 Linux/5.15.0-1033-azure
|
Security for slackops 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.