Fastprogress is a Python library providing fast and simple progress bars for Jupyter Notebooks and console applications. It features nested progress bars and plotting options, often used within the fastai ecosystem. The library is actively maintained with frequent minor releases, most recently v1.1.5, and has a cadence of several updates per year.
pip install fastprogressVerified import paths — ran on the pinned version, not inferred.
This example demonstrates a nested progress bar. `master_bar` handles the outer loop, and `progress_bar` handles the inner loop, linked via the `parent` argument. Comments can be updated, and `mb.write()` adds persistent messages.
Ensure `python-fasthtml` (and its underlying dependencies like SQLite development headers if building from source) can be installed in your environment. Consider pinning to a version <1.1.0 if `fasthtml` integration causes issues.
Always provide the `total` argument if the length of your iterable is known (e.g., `range(N)` or `len(my_list)`). For truly unknown lengths, you might explicitly pass `total='noinfer'` (supported since 1.0.3) or handle the display logic manually.
Design your scripts to rely on `mb.write()` for critical logging messages that need to be captured in non-interactive contexts. For debugging, ensure you run in a true TTY or Jupyter environment.
Ensure `IPython` and `ipywidgets` are correctly installed and configured in your environment (`pip install ipython ipywidgets`). For problematic environments, try explicitly using `ConsoleMasterBar` and `ConsoleProgressBar` or investigate `ipywidgets` installation troubleshooting steps.
pip install fastprogress
from fastprogress.fastprogress import master_bar, progress_bar
pip install ipython ipywidgets && jupyter nbextension enable --py widgetsnbextension
Use `mb.main_bar` instead of `mb.first_bar` to access the main progress bar.