Skip to content

bcicen/slack-progress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slack-progress

PyPI version

A realtime progress bar for Slack

screencap

Installing

pip install slack-progress

Usage

Create a SlackProgress object with your Slack token and channel name:

from slack_progress import SlackProgress
sp = SlackProgress('SLACK_TOKEN', 'CHANNEL_NAME')

Now you can simply wrap any iterator:

for i in sp.iter(range(500)):
    time.sleep(.2)

The bar position can also be set manually:

pbar = sp.new() # create new bar where 100% == pos 100
pbar.pos = 10
time.sleep(1)
pbar.pos = 100

pbar = 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:

pbar.pos = 50
pbar.log("Step 1 complete")
pbar.pos = 100
pbar.log("Step 2 complete")

About

A realtime progress bar for Slack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages