py-progress
Overview: py-progress is a Python library that allows you to easily display progress bar in your console while working with files and scripts. It provides customizable and visually appealing progress bars that help track the progress of ongoing tasks, making it easier for users to manage the execution of scripts or programs.
Features:
- Customizable text and color: Customize text, color, and background color for the progress bar to match your program's aesthetics.
- Time estimation: It can estimate the time remaining to finish tasks, keeping users updated on the expected duration.
- Easy integration: It can be integrated into your existing Python projects and scripts with minimal setup.
Structure: py-progress is composed of a single Python file - progress.py, which includes two main classes.
- TextStyle: This class is responsible for handling and formatting text, color, and background color for the progress bar.
- ProgressBar: This class measures and displays the progress of ongoing tasks, supporting a progress bar, calculations, and time estimations.
Usage:
To start using the py-progress library, you must first import the required classes from the py_progress package. Then, create an instance of the ProgressBar class, passing the total number of parts to be completed. To update the progress, call the progress() or progress_with_time() methods with the appropriate arguments.
Example:
from py_progress.progress import ProgressBar
from py_progress.progress import TextStyle
# Initialize TextStyle
text_style = TextStyle()
# Create an instance of ProgressBar
progress = ProgressBar(part=100)
# Update progress without time estimation
progress.progress("Task One")
# Update progress with time estimation
progress.progress_with_time("Task Two")
By incorporating py-progress into your Python projects, developers can enhance user experience by providing a clear visual indication of the progress of their tasks.
py-progress Documentation
py-progress is a lightweight Python library for displaying progress bars in various environments. It aims to provide an easy and universal way to integrate progress bars into your projects.
progress.py:
This Python module provides a simple progress bar to track the progress of tasks. It allows you to display the percentage of completion, custom text, and optionally, estimated time remaining.
Usage
Before using the progress bar in your project, make sure you import the necessary components:
from progress import ProgressBar, TextStyle
from colorama import Fore, Back, Style, init
Call init() method to initialize Colorama:
init()
Create a new instance of ProgressBar class specifying the total parts of the task:
progress_bar = ProgressBar(part)
There are two methods available for the ProgressBar class:
progress(name)- Updates the progress bar with the given name of the task.progress_with_time(name)- Updates the progress bar with the given name of the task and also displays the estimated time remaining for the task to be completed.
Here's a simple example of using the ProgressBar class:
from progress import ProgressBar, TextStyle
from time import sleep
init()
# Create ProgressBar instance
progress_bar = ProgressBar(part=100)
# Update progress with an example task without time tracking
for i in range(100):
progress_bar.progress(name="Processing task...")
sleep(0.1)
# Update progress with an example task with time tracking
progress_bar.start_time = time.time()
for i in range(100):
progress_bar.progress_with_time(name="Processing task with time...")
sleep(0.1)
In this example, we are filling the progress bar by looping 100 times. The progress(name) updates the progress without any time tracking, while progress_with_time(name) updates the progress and also calculates and displays the estimated time remaining for the task to be completed.
Release files for py-progress-lib 0.8.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py_progress_lib-0.8.5.tar.gz | 3.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| py_progress_lib-0.8.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.4 kB
Release files / py_progress_lib-0.8.5.tar.gz
| Download URL | py_progress_lib-0.8.5.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85755bcd9745dba852c57a7de4d38f4836760f15ed00b189c0f0974cbec2db07
|
|
BLAKE2b-256 checksum How to use checksums |
02bcc8ed24a6a48bb2fca021d56ffd7d02f1fa4739fc06518c9852d39a274e62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.12.8 Windows/11
|
Release files / py_progress_lib-0.8.5-py3-none-any.whl
| Download URL | py_progress_lib-0.8.5-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0099774215677a1ce8401e798cb2158cadb55e26287dc140a55fdf19fe0fe737
|
|
BLAKE2b-256 checksum How to use checksums |
399d0c72cd1ae8e28d8039755107b6cb630cfd6232ece68af5c73f0dfcec7696
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.12.8 Windows/11
|