-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,38 @@ | ||
<!DOCTYPE> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="format" content="complete"> | ||
</head> | ||
<body> | ||
|
||
<h1>PyPrind</h1> | ||
|
||
<p>The PyPrind (Python Progress Indicator) module provides a progress bar and a percentage indicator<br> | ||
object that let you track the progress of a loop structure or other iterative computation.<br> | ||
Typical applications include the processing of large data sets to provide an intuitive estimate | ||
<p>The PyPrind (Python Progress Indicator) module provides a progress bar and a percentage indicator<br>object that let you track the progress of a loop structure or other iterative computation.<br>Typical applications include the processing of large data sets to provide an intuitive estimate | ||
at runtime about the progress of the computation.</p> | ||
|
||
<h1>Installation</h1> | ||
|
||
<p>You can use the following command to install PyPrind:<br> | ||
<code>pip install pyprind</code><br> | ||
or<br> | ||
<code>easy_install pyprind</code> </p> | ||
|
||
<p>Alternatively, you download the package manually from the Python Package Index <a href="https://pypi.python.org/pypi/PyPrind">https://pypi.python.org/pypi/PyPrind</a>, unzip it, navigate into the package, and use the command:</p> | ||
|
||
<p><code>python setup.py install</code><br> | ||
or<br> | ||
<code>python3 setup.py install</code> </p> | ||
|
||
<p>You can use the following command to install PyPrind:<br><code>pip install pyprind</code><br> or<br><code>easy_install pyprind</code> </p> | ||
<p>Alternatively, you download the package manually from the Python Package Index <a href="https://pypi.python.org/pypi/PyPrind"><a href="https://pypi.python.org/pypi/PyPrind">https://pypi.python.org/pypi/PyPrind</a></a>, unzip it, navigate into the package, and use the command:</p> | ||
<p><code>python setup.py install</code><br>or<br><code>python3 setup.py install</code> </p> | ||
<h1>Documentation</h1> | ||
|
||
<p>PyPrind consists of two class objects that can visualize the progress of a computation on the output screen.<br> | ||
Progress bars are visualized via a <code>ProgBar()</code> object, and alternatively, the progress can be tracked and shown as percentage via a <code>ProgPercent()</code> object. </p> | ||
|
||
<p>PyPrind consists of two class objects that can visualize the progress of a computation on the output screen.<br>Progress bars are visualized via a <code>ProgBar()</code> object, and alternatively, the progress can be tracked and shown as percentage via a <code>ProgPercent()</code> object. </p> | ||
<p>The general usage of <code>ProgBar()</code> and <code>ProgPercent()</code> consists of three steps:</p> | ||
|
||
<p>1) initialize a new <code>ProgBar()</code> or <code>ProgPercent()</code> object with the number of iterations of the computation that is to be performed<br> | ||
2) update the <code>ProgBar()</code> or <code>ProgPercent()</code> object for each iteration via the <code>.update()</code>method<br> | ||
3) complete the progress visualization via the <code>.finish()</code> method after the computation is completed </p> | ||
|
||
<p>1) initialize a new <code>ProgBar()</code> or <code>ProgPercent()</code> object with the number of iterations of the computation that is to be performed<br>2) update the <code>ProgBar()</code> or <code>ProgPercent()</code> object for each iteration via the <code>.update()</code>method<br>3) complete the progress visualization via the <code>.finish()</code> method after the computation is completed </p> | ||
<pre>n = 10000000 | ||
my_prbar = pyprind.ProgBar(n) # 1) initialization with number of iterations | ||
for i in range(n): | ||
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> | ||
|
||
<h2>Optional parameters :</h2> | ||
|
||
<h2>Optional parameters :</h2> | ||
<h5>Setting the width of the progress bar</h5> | ||
|
||
<p><code>my_prog = pyprind.ProgBar(n, width=70) # default = 50</code></p> | ||
|
||
<p><code>my_prog = pyprind.ProgBar(n, width=70) # default = 50</code></p> | ||
<h5>Set whether CPU time should be reported or not</h5> | ||
|
||
<p>The optional <code>cpu_time</code> parameter can be set for both <code>ProgBar()</code> and <code>ProgPercent()</code> objects.<br> | ||
<p>The optional <code>cpu_time</code> parameter can be set for both <code>ProgBar()</code> and <code>ProgPercent()</code> objects. </p> | ||
<pre> | ||
my_prbar = pyprind.ProgBar(n)<br> | ||
… | ||
my_prbar.finish(cpu_time=False) # default = True<br> | ||
</pre></p> | ||
|
||
<h1>Examples</h1> | ||
|
||
<p>The following examples shall illustrate the typical usage of the PyPrind package.<br> | ||
A visualization can be viewed on YouTube: <a href="http://youtu.be/gjj5K8OWo7U">http://youtu.be/gjj5K8OWo7U</a></p> | ||
my_prbar = pyprind.ProgBar(n) | ||
... | ||
my_prbar.finish(cpu_time=False) # default = True | ||
</pre> | ||
|
||
<h2>Example - Progress Bar</h2> | ||
|
||
<h1>Examples</h1> | ||
<p>The following examples shall illustrate the typical usage of the PyPrind package.<br>A visualization can be viewed on YouTube: <a href="http://youtu.be/gjj5K8OWo7U"><a href="http://youtu.be/gjj5K8OWo7U">http://youtu.be/gjj5K8OWo7U</a></a></p> | ||
<h2>Example 1 - Progress Bar</h2> | ||
<pre>import pyprind | ||
|
||
n = 10000000 | ||
|
@@ -77,15 +43,15 @@ <h2>Example - Progress Bar</h2> | |
my_prbar.finish() | ||
</pre> | ||
|
||
<p><strong>Screen Output</strong> </p> | ||
|
||
<pre>sebastian > ./python3 examples/ex_percentage_indicator.py | ||
[100 %] | ||
Time elapsed: 2.6364 sec | ||
<p><strong>Screen Output</strong> </p> | ||
<pre>sebastian > python3 examples/ex_progress_bar.py | ||
0% 100% | ||
[########################################] | ||
Time elapsed: 0.7829 sec | ||
</pre> | ||
|
||
<h2>Example - Percentage Indicator</h2> | ||
|
||
<h2>Example 2 - Percentage Indicator</h2> | ||
<pre>import pyprind | ||
|
||
n = 1000000 | ||
|
@@ -96,19 +62,14 @@ <h2>Example - Percentage Indicator</h2> | |
my_perc.finish() | ||
</pre> | ||
|
||
<p><strong>Screen Output</strong> </p> | ||
|
||
<pre>sebastian > python3 examples/ex_progress_bar.py | ||
0% 100% | ||
[########################################] | ||
Time elapsed: 0.7829 sec | ||
<p><strong>Screen Output</strong> </p> | ||
<pre>sebastian > ./python3 examples/ex_percentage_indicator.py | ||
[100 %] | ||
Time elapsed: 2.6364 sec | ||
</pre> | ||
|
||
<h1> Contact</h1> | ||
|
||
<p>If you have any questions or comments about PyPrind, please feel free to contact me via<br> | ||
eMail: <a href="mailto:[email protected]">[email protected]</a><br> | ||
or Twitter: <a href="https://twitter.com/rasbt">@rasbt</a></p> | ||
|
||
</body> | ||
</html> | ||
|
||
<h1> Contact</h1> | ||
<p>If you have any questions or comments about PyPrind, please feel free to contact me via<br>eMail: <a href="mailto:[email protected]">[email protected]</a><br>or Twitter: <a href="https://twitter.com/rasbt">@rasbt</a></p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,4 +45,4 @@ | |
from .progbar import ProgBar | ||
from .progpercent import ProgPercent | ||
|
||
__version__ = '1.0.2' | ||
__version__ = '1.0.3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
from distutils.core import setup | ||
|
||
readme = open('README.txt', 'r') | ||
README_TEXT = readme.read() | ||
readme.close() | ||
|
||
|
||
setup(name='PyPrind', | ||
version='1.0.2', | ||
version='1.0.3', | ||
description='Python Progress Indicator Utility', | ||
author='Sebastian Raschka', | ||
author_email='[email protected]', | ||
url='https://github.com/rasbt/pyprind', | ||
download_url='https://github.com/rasbt/pyprind/archive/1.0.2.tar.gz', | ||
packages=['pyprind'], | ||
data_files = [('', ['LICENSE.txt']), | ||
('', ['README.html']), | ||
|
@@ -29,5 +23,34 @@ | |
'Programming Language :: Python :: 3', | ||
'Environment :: Console', | ||
], | ||
long_description = README_TEXT, | ||
long_description=""" | ||
PyPrind | ||
============= | ||
The PyPrind (Python Progress Indicator) module provides a progress bar and a | ||
percentage indicator object that let you track the progress of a loop | ||
structure or other iterative computation. | ||
Typical applications include the processing of large data sets to provide | ||
an intuitive estimate at runtime about the progress of the computation. | ||
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_progress_bar.py | ||
0% 100% | ||
[########################################] | ||
Time elapsed: 0.7829 sec | ||
""", | ||
) |