{"library":"pyprind","title":"PyPrind (Python Progress Indicator)","description":"PyPrind is a Python module that provides simple yet effective progress bar and percentage indicator utilities. It allows developers to visualize the progress of iterative computations, which is particularly useful for long-running processes or when handling large datasets. The library's current version is 2.11.3, with its last release in April 2021, indicating a slow release cadence and a current status of maintenance.","language":"python","status":"maintenance","last_verified":"Thu Apr 16","install":{"commands":["pip install pyprind"],"cli":null},"imports":["from pyprind import ProgBar","from pyprind import ProgPercent","import pyprind\nfor i in pyprind.prog_bar(range(n)): pass"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import time\nimport pyprind\n\nn = 10000000 # Number of iterations\n\n# Using ProgBar class\nbar = pyprind.ProgBar(n, title='Processing Data')\nfor i in range(n):\n    # Simulate some computation\n    # time.sleep(0.000001) # Uncomment to slow down and see progress\n    bar.update()\nprint(bar)\n\nprint(\"\\nAlternatively, using the generator function:\")\n# Using prog_bar generator function\nfor i in pyprind.prog_bar(range(n), title='Another Task'):\n    # Simulate some computation\n    pass # time.sleep(0.000001)\n\n# Example with monitor=True (requires psutil)\n# try:\n#     bar_monitor = pyprind.ProgBar(100, monitor=True, title='Monitoring System')\n#     for i in range(100):\n#         time.sleep(0.1)\n#         bar_monitor.update()\n#     print(bar_monitor)\n# except ValueError as e:\n#     print(f\"Warning: {e}. Install psutil (pip install psutil) for monitoring.\")\n","lang":"python","description":"This example demonstrates how to create a progress bar using the `ProgBar` class and the `prog_bar` generator function. It initializes a progress bar with a specified number of iterations and updates it within a loop. An optional section shows how to use the `monitor=True` feature, which requires the `psutil` package.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}