Skip to main content

fastprogress

A fast and simple progress bar for Jupyter Notebook and console. Created by Sylvain Gugger for fast.ai.

Copyright 2017 onwards, fast.ai. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. A copy of the License is provided in the LICENSE file in this repository.

Install

To install simply use

pip install fastprogress

or:

conda install -c fastai fastprogress 

Note that this requires python 3.6 or later.

Usage

Here is a simple example. Each bar takes an iterator as a main argument, and we can specify the second bar is nested with the first by adding the argument parent=mb. We can then

  • add a comment in the first bar by changing the value of mb.first_bar.comment
  • add a comment in the first bar by changing the value of mb.child.comment
  • write a line between the two bars with mb.write('message')
from fastprogress import master_bar, progress_bar
from time import sleep
mb = master_bar(range(10))
for i in mb:
    for j in progress_bar(range(100), parent=mb):
        sleep(0.01)
        mb.child.comment = f'second bar stat'
    mb.first_bar.comment = f'first bar stat'
    mb.write(f'Finished loop {i}.')
    #mb.update_graph(graphs, x_bounds, y_bounds)

To add a graph that get plots as the training goes, just use the command mb.update_graphs. It will create the figure on its first use. Arguments are:

  • graphs: a list of graphs to be plotted (each of the form [x,y])
  • x_bounds: the min and max values of the x axis (if None, it will those given by the graphs)
  • y_bounds: the min and max values of the y axis (if None, it will those given by the graphs)

Note that it's best to specify x_bounds and _bounds otherwise the box will change as the loop progresses.

Additionally, we can give the label of each graph via the command mb.names (should have as many elements as the graphs argument).

import numpy as np
mb = master_bar(range(10))
mb.names = ['cos', 'sin']
for i in mb:
    for j in progress_bar(range(100), parent=mb):
        if j%10 == 0:
            k = 100 * i + j
            x = np.arange(0, 2*k*np.pi/1000, 0.01)
            y1, y2 = np.cos(x), np.sin(x)
            graphs = [[x,y1], [x,y2]]
            x_bounds = [0, 2*np.pi]
            y_bounds = [-1,1]
            mb.update_graph(graphs, x_bounds, y_bounds)
            mb.child.comment = f'second bar stat'
    mb.first_bar.comment = f'first bar stat'
    mb.write(f'Finished loop {i}.')

Here is the rendering in console:

If the script using this is executed with a redirect to a file, only the results of the .write method will be printed in that file.

Metadata

Release files for fastprogress 0.1.20

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

Source distribution (sdist)

Source distribution for fastprogress 0.1.20
File Size Uploaded Provenance Actions
fastprogress-0.1.20.tar.gz 6.1 kB Without provenance Details for fastprogress-0.1.20.tar.gz

Built distribution (wheel)

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

Total release size: 16.1 kB

Release files / fastprogress-0.1.20.tar.gz

Download URL fastprogress-0.1.20.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
09114dd8a242005d127d9d8d61cfb39b989e24d3b9b892ff3bf6229a7286d9a9
BLAKE2b-256 checksum
How to use checksums
305b6e3f80dc4806cae449d171950f521846796c63c78c0b5c5264ac709f1170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Release files / fastprogress-0.1.20-py3-none-any.whl

Download URL fastprogress-0.1.20-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0c2045889ba5b06840c7907f5fe02002c8d506fa120547cb4bbef92627a7c37
BLAKE2b-256 checksum
How to use checksums
863001f597392e4e7b4982f387028da941e1fd60a8d53511d17225858d87fb22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Security for fastprogress 0.1.20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.20 This release

2 release files No provenance

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