A new kind of Progress Bar, with real-time throughput, eta and very cool animations!

# alive-progress :)

### A new kind of Progress Bar, with real-time throughput, eta and very cool animations!

Ever found yourself in a remote ssh session, doing some lengthy operations, and every now and then you feel the need to hit [RETURN] just to ensure you didn't lose the connection? Ever wondered where your processing was in, and when would it finish? Ever needed to pause the progress bar for a while, return to the prompt for a manual inspection or for fixing an item, and then resume the process like it never happened? I did...

I've made this cool progress bar thinking about all that, the Alive-Progress bar! :)

I like to think of it as a new kind of progress bar for python, as it has among other things:

• a cool live spinner, which clearly shows your lengthy process did not hang and your ssh connection is healthy;
• a visual feedback of the current speed/throughput, as the spinner runs faster or slower according to the actual processing speed;
• an efficient multi-threaded bar, which updates itself at a fraction of the actual speed (1,000,000 iterations per second equates to roughly 60 frames per second refresh rate) to keep CPU usage low and avoid terminal spamming; (📌 new: you can now calibrate this!)
• an expected time of arrival (ETA), with a smart exponential smoothing algorithm that shows the remaining processing time in the most friendly way;
• a print() hook and (📌 new) logging support, which allows print statements and logging messages effortlessly in the midst of an animated bar, automatically cleaning the screen and even enriching it with the current position when that occurred;
• after your processing has finished, a nice receipt is printed with the statistics of that run, including the elapsed time and observed throughput;
• it tracks your desired count, not necessarily the actual iterations, to detect under and overflows, so it will look different if you send in less or more than expected;
• it automatically detects if there's an allocated tty, and if there isn't (like in a pipe redirection), only the final receipt is printed, so you can safely include it in any code and rest assure your log file won't get thousands of progress lines;
• you can pause it! I think that's an unprecedented feature for a progress bar! It's incredible to be able to manually operate on some items while inside a running progress bar context, and get the bar back like it had never stopped whenever you want;
• it is customizable, with a growing smorgasbord of different bar and spinner styles, as well as several factories to easily generate yours!

### 📌 New in 1.6 series!

• soft wrapping support - or lack thereof actually, it won't scroll your terminal desperately up if it doesn't fit the line anymore!
• hiding cursor support - more beautiful and professional appearance!
• python logging support - adequately clean and enriched messages from logging without any configuration or hack!
• exponential smoothing of ETA - way smoother when you need it the most!
• proper bar title - left aligned always visible title so you know what is expected from that processing!
• enhanced elapsed time and ETA representation - the smallest rendition possible, so you can maximize the animations!
• new bar.text() dedicated method - now you can change the situational message without making the bar going forward!
• performance optimizations - even less overhead, your processing won't even notice it!

### 📌 Fixed in 1.6.2!

• new lines get printed on vanilla Python REPL;
• bar is truncated to 80 chars on Windows.

## Get it

Just install with pip:



## Changelog highlights:

• 1.6.2: new bar.current() method; newlines get printed on vanilla Python REPL; bar is truncated to 80 chars on Windows.
• 1.6.1: fix logging support for python 3.6 and lower; support logging for file; support for wide unicode chars, which use 2 columns but have length 1
• 1.6.0: soft wrapping support; hiding cursor support; python logging support; exponential smoothing of ETA time series; proper bar title, always visible; enhanced times representation; new bar.text() method, to set situational messages at any time, without incrementing position (deprecates 'text' parameter in bar()); performance optimizations
• 1.5.1: fix compatibility with python 2.7 (should be the last one, version 2 is in the works, with python 3 support only)
• 1.5.0: standard_bar accepts a background parameter instead of blank, which accepts arbitrarily sized strings and remains fixed in the background, simulating a bar going "over it"
• 1.4.4: restructure internal packages; 100% branch coverage of all animations systems, i.e., bars and spinners
• 1.4.3: protect configuration system against other errors (length='a' for example); first automated tests, 100% branch coverage of configuration system
• 1.4.2: sanitize text input, keeping \n from entering and replicating bar on screen
• 1.4.1: include license file in source distribution
• 1.4.0: print() enrichment can now be disabled (locally and globally), exhibits now have a real time fps indicator, new exhibit functions show_spinners and show_bars, new utility print_chars, show_bars gains some advanced demonstrations (try it again!)
• 1.3.3: further improve stream compatibility with isatty
• 1.3.2: beautifully finalize bar in case of unexpected errors
• 1.3.1: fix a subtle race condition that could leave artifacts if ended very fast, flush print buffer when position changes or bar terminates, keep total argument from unexpected types
• 1.3.0: new fps calibration system, support force_tty and manual options in global configuration, multiple increment support in bar handler
• 1.2.0: filled blanks bar styles, clean underflow representation of filled blanks
• 1.1.1: optional percentage in manual mode
• 1.1.0: new manual mode
• 1.0.1: pycharm console support with force_tty, improve compatibility with python stdio streams
• 1.0.0: first public release, already very complete and mature

## Did you like it?

I've put much ❤️ and effort into this.
If you've appreciated my work and would like me to continue improving it, you could buy me a coffee! I would really appreciate that 😊! (the button is on the top-right corner) Thank you!

## Project details

Uploaded source
Uploaded py3