No description
  • Python 98.8%
  • Makefile 1.2%
Find a file
Rick van Hattem 43d3a6e7d4 Merge tag 'v3.16.0' into develop
added items per second widget v3.16.0
2017-03-17 07:50:37 -07:00
docs removed out of date history 2016-09-08 12:00:14 +02:00
progressbar added items per second widget 2017-03-17 07:50:03 -07:00
tests added items per second widget 2017-03-17 07:50:03 -07:00
.coveragerc fixed tests 2016-05-27 16:50:23 +02:00
.gitignore Add a gitignore 2014-06-02 13:48:54 -05:00
.travis.yml removed pypy3 since its broken 2016-12-21 23:01:08 +01:00
appveyor.yml no reason to use specific 64 bit builds 2016-03-02 13:55:06 +01:00
CHANGES.rst updated changelog 2017-03-15 15:45:35 +01:00
circle.yml simplified circle-ci config 2016-03-02 15:18:46 +01:00
CONTRIBUTING.rst cookiecuttered package now 2015-10-11 13:27:14 +02:00
examples.py added items per second widget 2017-03-17 07:50:03 -07:00
ISSUE_TEMPLATE added issue template 2016-07-10 14:27:18 +02:00
LICENSE cookiecutter test 2015-10-10 14:43:26 +02:00
Makefile cookiecuttered package now 2015-10-11 13:27:14 +02:00
MANIFEST.in renamed changes 2015-10-11 13:34:52 +02:00
pytest.ini fixed release 2016-06-25 22:52:23 +02:00
README.rst Add syntax highlighting to code blocks at README 2017-01-06 08:32:38 -03:00
requirements.txt fixed docs, tox and travis 2016-06-09 18:00:40 +02:00
setup.cfg added tests for double output redirection 2016-06-26 23:17:28 +02:00
setup.py fixed pytest 2016-06-18 11:52:48 +02:00
tox.ini removed pypy3 since its broken 2016-12-21 23:01:08 +01:00

##############################################################################
Text progress bar library for Python.
##############################################################################

Travis status:

.. image:: https://travis-ci.org/WoLpH/python-progressbar.png?branch=master
  :target: https://travis-ci.org/WoLpH/python-progressbar

Coverage:

.. image:: https://coveralls.io/repos/WoLpH/python-progressbar/badge.png?branch=master
  :target: https://coveralls.io/r/WoLpH/python-progressbar?branch=master

******************************************************************************
Introduction
******************************************************************************

.. highlights::

    **NOTE:** This version has been completely rewritten and might not be
    100% compatible with the old version. If you encounter any problems
    while using it please let me know:
    https://github.com/WoLpH/python-progressbar/issues

A text progress bar is typically used to display the progress of a long
running operation, providing a visual cue that processing is underway.

The ProgressBar class manages the current progress, and the format of the line
is given by a number of widgets. A widget is an object that may display
differently depending on the state of the progress bar. There are many types
of widgets:

 - `Timer`
 - `ETA`
 - `AdaptiveETA`
 - `FileTransferSpeed`
 - `AdaptiveTransferSpeed`
 - `AnimatedMarker`
 - `Counter`
 - `Percentage`
 - `FormatLabel`
 - `SimpleProgress`
 - `Bar`
 - `ReverseBar`
 - `BouncingBar`
 - `RotatingMarker`
 - `DynamicMessage`

The progressbar module is very easy to use, yet very powerful. It will also
automatically enable features like auto-resizing when the system supports it.

******************************************************************************
Links
******************************************************************************

* Documentation
    - http://progressbar-2.readthedocs.org/en/latest/
* Source
    - https://github.com/WoLpH/python-progressbar
* Bug reports 
    - https://github.com/WoLpH/python-progressbar/issues
* Package homepage
    - https://pypi.python.org/pypi/progressbar2
* My blog
    - http://w.wol.ph/

******************************************************************************
Usage
******************************************************************************

There are many ways to use Python Progressbar, you can see a few basic examples
here but there are many more in the examples file.

Wrapping an iterable
==============================================================================
.. code:: python

   import time
   import progressbar

   bar = progressbar.ProgressBar()
   for i in bar(range(100)):
       time.sleep(0.02)

Context wrapper
==============================================================================
.. code:: python

   import time
   import progressbar

   with progressbar.ProgressBar(max_value=10) as bar:
       for i in range(10):
           time.sleep(0.1)
           bar.update(i)

Combining progressbars with print output
==============================================================================
.. code:: python

    import time
    import progressbar

    bar = progressbar.ProgressBar(redirect_stdout=True)
    for i in range(100):
        print 'Some text', i
        time.sleep(0.1)
        bar.update(i)

Progressbar with unknown length
==============================================================================
.. code:: python

    import time
    import progressbar

    bar = progressbar.ProgressBar(max_value=progressbar.UnknownLength)
    for i in range(20):
        time.sleep(0.1)
        bar.update(i)

Bar with custom widgets
==============================================================================
.. code:: python

    import time
    import progressbar

    bar = progressbar.ProgressBar(widgets=[
        ' [', progressbar.Timer(), '] ',
        progressbar.Bar(),
        ' (', progressbar.ETA(), ') ',
    ])
    for i in bar(range(20)):
        time.sleep(0.1)