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_basic.progress_basic 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_basic.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.5.tar.gz
.
File metadata
- Download URL: progress_basic-0.5.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 | 8bb4e97261735015eb8d68395564227e2c0353c2fff054d9cef099ad95cc3126 |
|
MD5 | 204404a12c9af2cd76c3574294037dce |
|
BLAKE2b-256 | 59e368d23f5e917cfc5046155f71072400f65c2a985f023e6088721fea84524f |
File details
Details for the file progress_basic-0.5-py3-none-any.whl
.
File metadata
- Download URL: progress_basic-0.5-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 | 703e2c51724b957aacb9717b636ae45b0fcd1b343ccbb2d4ec1f919220bf9332 |
|
MD5 | b0519d291c79d15008c5ea3aaf46d7ad |
|
BLAKE2b-256 | 89de628b29c19a432f4888cacca87abd8bafcac4799a10f10f8beb03808db841 |