A Python package for displaying progress bars in Slack messages.
Project description
slack-progress-bar
A Python library for adding a progress bar to a Slack Bot, updated for Python 3.9+.
Installation
pip install slack-progress-bar
Tutorial
- Setup your bot using the Slack API and grab the associated
Bot User OAuth Token
(Settings -> Install App). - Get the
user_id
for the person you want to receive updates. This can be found by going to a Slack profile and clicking Copy member ID.
import time
from slack_progress_bar import SlackProgressBar
progress_bar = SlackProgressBar(token=BOT_TOKEN, user_id=SLACK_MEMBER_ID, total=150)
for i in range(151):
time.sleep(0.1)
progress_bar.update(i)
Instantiating a SlackProgressBar
will send a message featuring an empty progress bar. from the bot account to your Slack user. The message will be sent from your Bot account to your Slack user in a private message.
Calling update()
will update that progress bar on Slack.
To create a new progress bar on Slack, instantiate a new instance of SlackProgressBar
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for slack_progress_bar-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54c6488f3868a40f160f284f687ea996a752d8b54723d47d644fdea470c8e846 |
|
MD5 | e80ac2d97c628c81ed7100625298abf7 |
|
BLAKE2b-256 | 749e99bc2f6a85fda0bd8f396da12bcadfd8b4a238df690af92cfc6adbd0b55b |