Metadata-Version: 2.4
Name: progressbar2
Version: 4.6.0
Summary: A Python Progressbar library to provide visual (yet text based) progress to long running operations.
Author-email: "Rick van Hattem (Wolph)" <wolph@wol.ph>
License: BSD-3-Clause
Project-URL: bugs, https://github.com/wolph/python-progressbar/issues
Project-URL: documentation, https://progressbar-2.readthedocs.io/en/latest/
Project-URL: repository, https://github.com/wolph/python-progressbar/
Keywords: REPL,animated,bar,color,console,duration,efficient,elapsed,eta,feedback,live,meter,monitor,monitoring,multi-threaded,progress,progress-bar,progressbar,progressmeter,python,rate,simple,speed,spinner,stats,terminal,throughput,time,visual
Classifier: Development Status :: 5 - Production/Stable
Classifier: Development Status :: 6 - Mature
Classifier: Environment :: Console
Classifier: Environment :: MacOS X
Classifier: Environment :: Other Environment
Classifier: Environment :: Win32 (MS Windows)
Classifier: Environment :: X11 Applications
Classifier: Framework :: IPython
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Other Audience
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: MS-DOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: Microsoft
Classifier: Operating System :: POSIX :: BSD :: FreeBSD
Classifier: Operating System :: POSIX :: BSD
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: POSIX :: SunOS/Solaris
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Implementation :: IronPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Python :: Implementation
Classifier: Programming Language :: Python
Classifier: Programming Language :: Unix Shell
Classifier: Topic :: Desktop Environment
Classifier: Topic :: Education :: Computer Aided Instruction (CAI)
Classifier: Topic :: Education :: Testing
Classifier: Topic :: Office/Business
Classifier: Topic :: Other/Nonlisted Topic
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Pre-processors
Classifier: Topic :: Software Development :: User Interfaces
Classifier: Topic :: System :: Installation/Setup
Classifier: Topic :: System :: Logging
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: System :: Shells
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: python-utils>=3.8.1
Provides-Extra: fast
Requires-Dist: speedups>=2.1.0; extra == "fast"
Provides-Extra: docs
Requires-Dist: sphinx>=1.8.5; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=1.6.0; extra == "docs"
Provides-Extra: tests
Requires-Dist: dill>=0.3.6; extra == "tests"
Requires-Dist: freezegun>=0.3.11; extra == "tests"
Requires-Dist: pytest-cov>=2.6.1; extra == "tests"
Requires-Dist: pytest>=4.6.9; extra == "tests"
Requires-Dist: pywin32; sys_platform == "win32" and extra == "tests"
Provides-Extra: docs-tests
Requires-Dist: playwright>=1.48.0; extra == "docs-tests"
Requires-Dist: pytest>=4.6.9; extra == "docs-tests"
Dynamic: license-file

##############################################################################
progressbar2
##############################################################################

A typed terminal progress bar library for Python. It handles custom
widgets, clean output around prints and logs, multiple concurrent bars,
unknown-length progress, and pipe-friendly CLI usage.

.. image:: https://github.com/WoLpH/python-progressbar/actions/workflows/main.yml/badge.svg
    :alt: python-progressbar test status
    :target: https://github.com/WoLpH/python-progressbar/actions

.. image:: https://coveralls.io/repos/WoLpH/python-progressbar/badge.svg?branch=master
    :alt: coverage status
    :target: https://coveralls.io/r/WoLpH/python-progressbar?branch=master

Install
==============================================================================

.. code:: sh

    pip install progressbar2

Quick start
==============================================================================

.. code:: python

    import time
    import progressbar

    for item in progressbar.progressbar(range(100), desc='Loading'):
        time.sleep(0.02)

Try it in your browser
==============================================================================

Every example in the `documentation <https://progressbar-2.readthedocs.io/en/latest/>`_
runs live in the page. Press **Run** on any code block, no install required.

Progress with clean logs
==============================================================================

.. image:: https://raw.githubusercontent.com/wolph/python-progressbar/develop/docs/_static/demos/readme-hero.svg
    :alt: progressbar2 showing clean progress output with logs

.. code:: python

    """A build log printing above a progress bar without corrupting it."""

    from __future__ import annotations

    import time

    import progressbar

    STEPS = 24


    def main() -> None:
        with progressbar.ProgressBar(
            max_value=STEPS,
            prefix='Build ',
            redirect_stdout=True,
        ) as bar:
            for step in range(STEPS):
                if step in {8, 16}:
                    print(f'log: completed step {step}')
                bar.update(step + 1)
                # Longer than the bar's 0.05s update gate, so every step
                # lands as a visible redraw.
                time.sleep(0.1)


    if __name__ == '__main__':
        main()

Multiple bars
==============================================================================

.. image:: https://raw.githubusercontent.com/wolph/python-progressbar/develop/docs/_static/demos/readme-multibar.svg
    :alt: multiple progress bars updating together

.. code:: python

    """Two named bars progressing at different rates in one terminal."""

    from __future__ import annotations

    import sys
    import time

    import progressbar

    STEPS = 24


    def main() -> None:
        with progressbar.MultiBar(fd=sys.stdout) as multibar:
            build = multibar['build']
            test = multibar['test']
            build.max_value = STEPS
            test.max_value = STEPS
            for step in range(STEPS):
                build.update(step + 1)
                test.update(min(STEPS, max(0, round((step - 3) * 1.2))))
                # Longer than the bars' 0.05s update gate, so every step
                # lands as a visible redraw.
                time.sleep(0.1)

            # Reaching max_value doesn't finish a bar -- only finish() does.
            # A MultiBar waits for every bar to report finished() before its
            # context manager can exit, so without these calls the block
            # above would hang forever on exit.
            build.finish()
            test.finish()


    if __name__ == '__main__':
        main()

Unknown length and animated bars
==============================================================================

.. image:: https://raw.githubusercontent.com/wolph/python-progressbar/develop/docs/_static/demos/readme-unknown-length.svg
    :alt: unknown length progress with an animated marker

.. code:: python

    """A bar for work whose total is not known up front."""

    from __future__ import annotations

    import time

    import progressbar


    def main() -> None:
        with progressbar.ProgressBar(
            max_value=progressbar.UnknownLength,
        ) as bar:
            for value in range(0, 120, 10):
                bar.update(value)
                # Longer than the bar's 0.05s update gate, so every step
                # lands as a visible redraw.
                time.sleep(0.1)


    if __name__ == '__main__':
        main()

CLI usage
==============================================================================

.. code:: sh

    progressbar --progress --timer --eta --rate --bytes input.bin -o output.bin

Known terminal caveats
==============================================================================

* JetBrains IDEs need "Enable terminal in output console" for advanced
  terminal behavior such as ``MultiBar``.
* IDLE does not support terminal progress bars.
* Jupyter buffers stdout; call ``sys.stdout.flush()`` when output appears late.

Project history
==============================================================================

progressbar2 is based on the old Python progressbar package that was published
on the now defunct Google Code. Since that project was completely abandoned by
its developer and the developer did not respond to email, I decided to fork the
package.

This package is still backwards compatible with the original progressbar
package so you can use it as a drop-in replacement for existing projects.

Links
==============================================================================

* Documentation: https://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
