progress


Nameprogress JSON
Version 1.6 PyPI version JSON
download
home_pagehttp://github.com/verigak/progress/
SummaryEasy to use progress bars
upload_time2021-07-28 06:52:43
maintainer
docs_urlNone
authorGeorgios Verigakis
requires_python
licenseISC
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Easy progress reporting for Python
==================================

|pypi|

|demo|

.. |pypi| image:: https://img.shields.io/pypi/v/progress.svg
   :target: https://pypi.org/project/progress/
.. |demo| image:: https://raw.github.com/verigak/progress/master/demo.gif
   :alt: Demo

Bars
----

There are 7 progress bars to choose from:

- ``Bar``
- ``ChargingBar``
- ``FillingSquaresBar``
- ``FillingCirclesBar``
- ``IncrementalBar``
- ``PixelBar``
- ``ShadyBar``

To use them, just call ``next`` to advance and ``finish`` to finish:

.. code-block:: python

    from progress.bar import Bar

    bar = Bar('Processing', max=20)
    for i in range(20):
        # Do some work
        bar.next()
    bar.finish()

or use any bar of this class as a context manager:

.. code-block:: python

    from progress.bar import Bar

    with Bar('Processing', max=20) as bar:
        for i in range(20):
            # Do some work
            bar.next()

The result will be a bar like the following: ::

    Processing |#############                   | 42/100

To simplify the common case where the work is done in an iterator, you can
use the ``iter`` method:

.. code-block:: python

    for i in Bar('Processing').iter(it):
        # Do some work

Progress bars are very customizable, you can change their width, their fill
character, their suffix and more:

.. code-block:: python

    bar = Bar('Loading', fill='@', suffix='%(percent)d%%')

This will produce a bar like the following: ::

    Loading |@@@@@@@@@@@@@                   | 42%

You can use a number of template arguments in ``message`` and ``suffix``:

==========  ================================
Name        Value
==========  ================================
index       current value
max         maximum value
remaining   max - index
progress    index / max
percent     progress * 100
avg         simple moving average time per item (in seconds)
elapsed     elapsed time in seconds
elapsed_td  elapsed as a timedelta (useful for printing as a string)
eta         avg * remaining
eta_td      eta as a timedelta (useful for printing as a string)
==========  ================================

Instead of passing all configuration options on instatiation, you can create
your custom subclass:

.. code-block:: python

    class FancyBar(Bar):
        message = 'Loading'
        fill = '*'
        suffix = '%(percent).1f%% - %(eta)ds'

You can also override any of the arguments or create your own:

.. code-block:: python

    class SlowBar(Bar):
        suffix = '%(remaining_hours)d hours remaining'
        @property
        def remaining_hours(self):
            return self.eta // 3600


Spinners
========

For actions with an unknown number of steps you can use a spinner:

.. code-block:: python

    from progress.spinner import Spinner

    spinner = Spinner('Loading ')
    while state != 'FINISHED':
        # Do some work
        spinner.next()

There are 5 predefined spinners:

- ``Spinner``
- ``PieSpinner``
- ``MoonSpinner``
- ``LineSpinner``
- ``PixelSpinner``

Installation
============

Download from PyPi

.. code-block:: shell

    pip install progress


Other
=====

There are a number of other classes available too, please check the source or
subclass one of them to create your own.


License
=======

progress is licensed under ISC

            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/verigak/progress/",
    "name": "progress",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Georgios Verigakis",
    "author_email": "verigak@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2a/68/d8412d1e0d70edf9791cbac5426dc859f4649afc22f2abbeb0d947cf70fd/progress-1.6.tar.gz",
    "platform": "",
    "description": "Easy progress reporting for Python\n==================================\n\n|pypi|\n\n|demo|\n\n.. |pypi| image:: https://img.shields.io/pypi/v/progress.svg\n   :target: https://pypi.org/project/progress/\n.. |demo| image:: https://raw.github.com/verigak/progress/master/demo.gif\n   :alt: Demo\n\nBars\n----\n\nThere are 7 progress bars to choose from:\n\n- ``Bar``\n- ``ChargingBar``\n- ``FillingSquaresBar``\n- ``FillingCirclesBar``\n- ``IncrementalBar``\n- ``PixelBar``\n- ``ShadyBar``\n\nTo use them, just call ``next`` to advance and ``finish`` to finish:\n\n.. code-block:: python\n\n    from progress.bar import Bar\n\n    bar = Bar('Processing', max=20)\n    for i in range(20):\n        # Do some work\n        bar.next()\n    bar.finish()\n\nor use any bar of this class as a context manager:\n\n.. code-block:: python\n\n    from progress.bar import Bar\n\n    with Bar('Processing', max=20) as bar:\n        for i in range(20):\n            # Do some work\n            bar.next()\n\nThe result will be a bar like the following: ::\n\n    Processing |#############                   | 42/100\n\nTo simplify the common case where the work is done in an iterator, you can\nuse the ``iter`` method:\n\n.. code-block:: python\n\n    for i in Bar('Processing').iter(it):\n        # Do some work\n\nProgress bars are very customizable, you can change their width, their fill\ncharacter, their suffix and more:\n\n.. code-block:: python\n\n    bar = Bar('Loading', fill='@', suffix='%(percent)d%%')\n\nThis will produce a bar like the following: ::\n\n    Loading |@@@@@@@@@@@@@                   | 42%\n\nYou can use a number of template arguments in ``message`` and ``suffix``:\n\n==========  ================================\nName        Value\n==========  ================================\nindex       current value\nmax         maximum value\nremaining   max - index\nprogress    index / max\npercent     progress * 100\navg         simple moving average time per item (in seconds)\nelapsed     elapsed time in seconds\nelapsed_td  elapsed as a timedelta (useful for printing as a string)\neta         avg * remaining\neta_td      eta as a timedelta (useful for printing as a string)\n==========  ================================\n\nInstead of passing all configuration options on instatiation, you can create\nyour custom subclass:\n\n.. code-block:: python\n\n    class FancyBar(Bar):\n        message = 'Loading'\n        fill = '*'\n        suffix = '%(percent).1f%% - %(eta)ds'\n\nYou can also override any of the arguments or create your own:\n\n.. code-block:: python\n\n    class SlowBar(Bar):\n        suffix = '%(remaining_hours)d hours remaining'\n        @property\n        def remaining_hours(self):\n            return self.eta // 3600\n\n\nSpinners\n========\n\nFor actions with an unknown number of steps you can use a spinner:\n\n.. code-block:: python\n\n    from progress.spinner import Spinner\n\n    spinner = Spinner('Loading ')\n    while state != 'FINISHED':\n        # Do some work\n        spinner.next()\n\nThere are 5 predefined spinners:\n\n- ``Spinner``\n- ``PieSpinner``\n- ``MoonSpinner``\n- ``LineSpinner``\n- ``PixelSpinner``\n\nInstallation\n============\n\nDownload from PyPi\n\n.. code-block:: shell\n\n    pip install progress\n\n\nOther\n=====\n\nThere are a number of other classes available too, please check the source or\nsubclass one of them to create your own.\n\n\nLicense\n=======\n\nprogress is licensed under ISC\n",
    "bugtrack_url": null,
    "license": "ISC",
    "summary": "Easy to use progress bars",
    "version": "1.6",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "7389594900723583f14a97669ba4ef0a",
                "sha256": "c9c86e98b5c03fa1fe11e3b67c1feda4788b8d0fe7336c2ff7d5644ccfba34cd"
            },
            "downloads": -1,
            "filename": "progress-1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "7389594900723583f14a97669ba4ef0a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7842,
            "upload_time": "2021-07-28T06:52:43",
            "upload_time_iso_8601": "2021-07-28T06:52:43.671602Z",
            "url": "https://files.pythonhosted.org/packages/2a/68/d8412d1e0d70edf9791cbac5426dc859f4649afc22f2abbeb0d947cf70fd/progress-1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-07-28 06:52:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "verigak",
    "github_project": "progress",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "progress"
}
        
Elapsed time: 0.01444s