Skip to main content

Interactive ProgressBar

Python progress bar that uses native ipython functionality. Widget-free. Works even in JupyterLab.

The reason for creating this package is that other progress bars use custom bar objects and/or widget tools, ignoring the builtin IPython functionality. This makes them unusable in "clean" environments like JupyterLab. In contrast, ipypb can run even in very restricted environments.

Another useful feature of ipypb is that the progress bar information is available even after closing a notebook and killing its ipython kernel. Once you launch this notebook again, you'll see the same progress bar information as before closing instead of widjet-related erorrs like Failed to display Jupyter Widget of type HBox, as shown below:

tqdm - display failure

Also have a look at this NBViewer example.

Notes

Currently at beta stage.

Simple usage example:

from time import sleep
from ipypb import track

for i in track(range(10)):
    sleep(0.1)

A few other conveniences are available. For example, you can use ipypb as a python's range-like function:

from ipypb import irange

for i in irange(1, 10, 2): # same as range(1, 10, 2) but with progressbar
    # <do stuff>
    ...

It may also be helpful to use the factory method ipb, which handles different usage scenarios and returns either track or irange instance depending on input arguments. Another usage example is when you already have a bunch of code with tqdm and want to replace it with ipypb:

from ipypb import ipb

tqdm_notebook = ipb
# or if you run it in interactive shell
tqdm = ipb

It will automatically process keyword arguments to ensure compatibility with tqdm's API. Note, that ipb offers a common interface for both notebook and terminal environments.

Asynchronous flow

It's also possible to use ipypb for tracking tasks that are executed asyncrhonously or in parallel. The major use case is when the order of executed tasks from a task pool doesn't correspond to the desired order for displaying a progress. In this case, you can instruct ipypb to preserve the desired order by submitting a description of the progress hierarchy. Below is an example for simple heirarchy consisting of three levels: i <-- j <-- k. Progress on each parent level depends on full exectunion of its sublevels. Note how levels k:1 and k:2 get moved to the group j:0 they belong to, even though initially they appear in the end, below the j:1 group:

ipypb - async flow

Note: this feature is currently in provisional state, which means that its API main change in future releases. In order to test it, do

from ipypb import chain

Install

pip install --upgrade ipypb

Requirements

Python 3.6+ and IPython v.5.6+ excluding v.6.1 and v.6.2

Limitations

  • The feature to erase progressbar when loop is over is not yet supported.

Metadata

Release files for ipypb 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipypb 0.5.2
File Size Uploaded
ipypb-0.5.2.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ipypb 0.5.2
File Interpreter ABI Platform
ipypb-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.1 kB

Release files / ipypb-0.5.2.tar.gz

Download URL ipypb-0.5.2.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ce87f3845502ca1e47a69aa79a03fbca13edd8e23fbcdbe608c4c6b243bed2b3
BLAKE2b-256 checksum
How to use checksums
d43d27a4c48c11e06b7f0ffe9898156f29184dc68698e70bb556daa9638474b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Release files / ipypb-0.5.2-py3-none-any.whl

Download URL ipypb-0.5.2-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
625a201d4c912ac498fa297f19291959f3dadbd37247d873d0291bf197e0f82d
BLAKE2b-256 checksum
How to use checksums
03340690f80e96e5fe8dbc8b29ed5255ad066555e13807989084eac6d4ca4fca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page