A simple progress bar with the ILoveCandy style
Project description
CandyBar
A Progress Bar inspired by Arch pacman with ILoveCandy
option enabled.
Instalation
Manual instalation
Clone the repository, build, and install the package:
git clone https://github.com/MacDumi/CandyBar.git
cd CandyBar
pip install .
Install from PyPi
pip install candy_bar
Usage
Import the package and create the progress bar object:
from candy_bar import CandyBar
cb = CandyBar(100, "Progress")
Parameters
Parameter | Default | Description |
---|---|---|
total | 100 | Defines the value corresponding to 100% |
message | None |
Write some text at the beginning of the line |
width | console size |
Size (in chars) of the bar, by default max console size |
left_justified | True | Defines the justification of the bar (not the message text) |
To update the position of the progress bar use the update
method:
total = 100
for i in range(total + 1):
# Your code goes here
cb.update(i)
The total value, the message, and the justification of the progress bar can be changed:
cb.set_total(150)
cb.set_message("Another message")
cb.set_left_justified(False)
Like what I do?
Buy me coffee
85jJPcfLPZRUKm3Re6qHZsKBZskVS2tYMWFoY5sYXUSQJzqzqpuPFepXMtqTKCRfuhYXaiJ3zQVeRPDYJUfepVjnJDpApH5
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
candy_bar-1.2.10.tar.gz
(34.1 kB
view hashes)