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 associate bot
token
. - 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
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 to your Slack user featuring your empty progress bar.
Calling update()
will update that progress bar on Slack.
To create a new progress bar, 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.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efd8fd8c2a014403c2abe6c0a3b8d70f62da1aa4ed35d1211244db3640e6bb28 |
|
MD5 | 6d3581336e10610b04ba479949482081 |
|
BLAKE2b-256 | eb08f4e4febfaa88d2e20fdd25f3d04ded980629026d95648b52216cd0cdb59d |