A Python library for displaying progress indicators and progress bars in the console with customizable messages and colors.
Project description
Progress Indicator Library
A Python library providing two classes for displaying progress indicators in the console: ProgressIndicator
and ProgressBar
. These classes help visualize ongoing tasks by displaying an animated spinner or a progress bar, respectively.
Installation
To install the library, you can use pip:
pip install progress_basic
Usage
ProgressIndicator
The ProgressIndicator class displays an animated spinner with a customizable message and color.
Example
from progress_basic.format.color_text import AnsiColors
from progress_indicator import ProgressIndicator
with ProgressIndicator("Processing", color=AnsiColors.OKBLUE) as pi:
# Simulate a long-running task
time.sleep(5)
ProgressBar
The ProgressBar class displays a progress bar that updates as tasks progress, with customizable total steps, message, interval, bar length, and color.
Example
from progress_basic.format.color_text import AnsiColors
from progress_bar import ProgressBar
total_steps = 100
with ProgressBar(total_steps, message="Loading", color=AnsiColors.OKBLUE) as pb:
for i in range(total_steps):
pb.update(i + 1)
time.sleep(0.1) # Simulate work
Classes
ProgressIndicator
A class for displaying an animated spinner with a customizable message and color.
ProgressBar
A class for displaying a progress bar that updates as tasks progress, with customizable total steps, message, interval, bar length, and color.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file progress_basic-0.4.tar.gz
.
File metadata
- Download URL: progress_basic-0.4.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 179d961724b6c1a715c212482b802583a2ca0dd0af7f5fac3e00ef3572014f19 |
|
MD5 | eb79783501097d9f6496b676482717aa |
|
BLAKE2b-256 | 28dc03cecc5ef1c5b98f9016660096e0e728bfa74895c5434e310a49d83b2d37 |
File details
Details for the file progress_basic-0.4-py3-none-any.whl
.
File metadata
- Download URL: progress_basic-0.4-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c671d96ca626cb4d6f4250f7d6a676d16716662e3324b4f60bdaf756f07a94f1 |
|
MD5 | ca1e7b1102c9e1eeb6abc406453de775 |
|
BLAKE2b-256 | 158c45e63fc629cd617ec746819fe53f831cb6d17ac4cead2b00a5b6ca0c63a2 |