Skip to main content

Python Progress Indicator Utility

Project description

PyPrind
=======

The PyPrind (Python Progress Indicator) module lets you visualize the
progress of a programming task in Python via a progress bar or a
percentage indicator.



Installation
------------

You can use the following command to install PyPrind:
> pip install pyprind

Or you download the package manually, unzip it, and install it from the
package folder via:

>python setup.py install
or
> python3 setup.py install


Documentation
-------------

PyPrind consists of two class objects that can visualize the progress of
a computation on the output screen.
Progress bars are visualized via a `ProgBar()` object, and
alternatively, the progress can be shown as an percentage via the
`ProgPercent()` object.

The general usage of `ProgBar()` and `ProgPercent()` consists of three
steps:

1) initialize a new `ProgBar()` or `ProgPercent()` object with the
number of iterations of the computation that is to be performed
2) update the `ProgBar()` or `ProgPercent()` object for each iteration
via the `.update()`method
3) complete the progress visualization via the `.finish()` method after
the computation is completed

EXAMPLE CODE:

n = 10000000
my_progress = pyprind.ProgBar(n) # 1) initialization with number of iterations
for i in range(n):
# do some computation
my_prbar.update() # 2) update the progress visualization
my_prbar.finish() # 3) complete the progress visualization


OPTIONAL PARAMETERS:

- Setting the width of the progress bar:

`my_prog = pyrpind.ProgBar(width=70) # default = 50`


- Set whether CPU time should be reported or not.
The optional `cpu_time` parameter can be set for both `ProgBar()` and
`ProgPercent()` objects.\

E.g.,
`my_prog.finish(cpu_time=False) # (default = True)`



Examples
--------

The following examples shall illustrate the typical usage of the PyPrind
package.
An visualization can be viewed on YouTube: http://youtu.be/gjj5K8OWo7U

- Example - Progress Bar

import pyprind

n = 10000000
my_prbar = pyprind.ProgBar(n)
for i in range(n):
# do some computation
my_prbar.update()
my_prbar.finish()

**Screen Output**

sebastian > ./python3 examples/ex_percentage_indicator.py
[100 %]
Time elapsed: 2.6364 sec


- Example - Percentage Indicator

import pyprind

n = 1000000
my_perc = pyprind.ProgPercent(n)
for i in range(n):
# do some computation
my_perc.update()
my_perc.finish()

**Screen Output**

sebastian > python3 examples/ex_progress_bar.py
0% 100%
[########################################]
Time elapsed: 0.7829 sec


Contact
-------------

If you have any questions or comments about PyPrind, please feel free to
contact me via
eMail: se.raschka@gmail.com
or Twitter: @rasbt https://twitter.com/rasbt

Project details


Release history Release notifications

History Node

2.11.2

History Node

2.11.1

History Node

2.11.0

History Node

2.10.0

History Node

2.9.9

History Node

2.9.8

History Node

2.9.7

History Node

2.9.6

History Node

2.9.5

History Node

2.9.4

History Node

2.9.3

History Node

2.9.2

History Node

2.9.1

History Node

2.9.0

History Node

2.8.0

History Node

2.6.2

History Node

2.6.1

History Node

2.6.0

History Node

2.5.0

History Node

2.4.0

History Node

2.3.1

History Node

2.3.0

History Node

2.2.0

History Node

2.1.1

History Node

2.1.0

History Node

2.0.3

History Node

2.0.2

History Node

2.0.1

History Node

2.0.0

History Node

1.1.1

History Node

1.1.0

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

This version
History Node

1.0.1dev

History Node

1.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
PyPrind-1.0.1dev.tar.gz (16.4 kB) Copy SHA256 hash SHA256 Source None Jan 26, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page