Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bcicen/slack-progress
A realtime progress bar for Slack
https://github.com/bcicen/slack-progress
Last synced: about 2 months ago
JSON representation
A realtime progress bar for Slack
- Host: GitHub
- URL: https://github.com/bcicen/slack-progress
- Owner: bcicen
- License: mit
- Created: 2016-09-12T14:00:10.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-04T19:08:19.000Z (almost 6 years ago)
- Last Synced: 2024-07-11T14:54:44.033Z (3 months ago)
- Language: Python
- Size: 16.6 KB
- Stars: 99
- Watchers: 6
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slack-progress
[![PyPI version](https://badge.fury.io/py/slack-progress.svg)](https://badge.fury.io/py/slack-progress)
A realtime progress bar for Slack
![screencap][screencap]
## Installing
```bash
pip install slack-progress
```## Usage
Create a SlackProgress object with your Slack token and channel name:
```python
from slack_progress import SlackProgress
sp = SlackProgress('SLACK_TOKEN', 'CHANNEL_NAME')
```Now you can simply wrap any iterator:
```python
for i in sp.iter(range(500)):
time.sleep(.2)
```The bar position can also be set manually:
```python
pbar = sp.new() # create new bar where 100% == pos 100
pbar.pos = 10
time.sleep(1)
pbar.pos = 100pbar = sp.new(total=500) # create new bar where 100% == pos 500
pbar.pos = 100 # 20% complete
time.sleep(1)
pbar.pos = 500 # 100% complete
```You can add logging messages too:
```python
pbar.pos = 50
pbar.log("Step 1 complete")
pbar.pos = 100
pbar.log("Step 2 complete")
```[screencap]: http://i.imgur.com/103z4Io.gif "slack-progress"