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
.. raw:: html
<pre>
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
</pre>
### 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
.. raw:: html
<pre>import pyprind
n = 10000000
my_prbar = pyprind.ProgBar(n)
for i in range(n):
# do some computation
my_prbar.update()
my_prbar.finish() </pre>
Screen Output:
^^^^^^^^^^^^^^
.. raw:: html
<pre>sebastian > ./python3 examples/ex_percentage_indicator.py
[100 %]
Time elapsed: 2.6364 sec
</pre>
Example - Percentage Indicator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. raw:: html
<pre>import pyprind
n = 1000000
my_perc = pyprind.ProgPercent(n)
for i in range(n):
# do some computation
my_perc.update()
my_perc.finish() </pre>
Screen Output
^^^^^^^^^^^^^
.. raw:: html
<pre>sebastian > python3 examples/ex_progress_bar.py
0% 100%
[########################################]
Time elapsed: 0.7829 sec
</pre>
## Contact
| If you have any questions or comments about PyPrind, please feel free
to contact me via
| eMail: se.raschka@gmail.com
| or Twitter: `https://twitter.com/rasbt <@rasbt>`__
=======
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
.. raw:: html
<pre>
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
</pre>
### 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
.. raw:: html
<pre>import pyprind
n = 10000000
my_prbar = pyprind.ProgBar(n)
for i in range(n):
# do some computation
my_prbar.update()
my_prbar.finish() </pre>
Screen Output:
^^^^^^^^^^^^^^
.. raw:: html
<pre>sebastian > ./python3 examples/ex_percentage_indicator.py
[100 %]
Time elapsed: 2.6364 sec
</pre>
Example - Percentage Indicator
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. raw:: html
<pre>import pyprind
n = 1000000
my_perc = pyprind.ProgPercent(n)
for i in range(n):
# do some computation
my_perc.update()
my_perc.finish() </pre>
Screen Output
^^^^^^^^^^^^^
.. raw:: html
<pre>sebastian > python3 examples/ex_progress_bar.py
0% 100%
[########################################]
Time elapsed: 0.7829 sec
</pre>
## Contact
| If you have any questions or comments about PyPrind, please feel free
to contact me via
| eMail: se.raschka@gmail.com
| or Twitter: `https://twitter.com/rasbt <@rasbt>`__
Metadata
Release files for PyPrind 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| PyPrind-1.0.0.tar.gz | 15.5 kB | Without provenance | Details |
Release files / PyPrind-1.0.0.tar.gz
| Download URL | PyPrind-1.0.0.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df665c07f6ff0d9b01282fbd3c8e1d5b23ffaab5aeb25312767703bddef3d613
|
|
BLAKE2b-256 checksum How to use checksums |
f7a9efc70f0d18c636b24f0080aa283ad822069439f61bdafd1315956b660775
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for PyPrind 1.0.0
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.