Describes the progress of work across rows
Project description
progrow
progrow
is a Python package for describing the progress of work across rows.
For example, this code:
from progrow import Rows, Style
rows = Rows()
rows.append("zilcho", current=0, maximum=5)
rows.append("one", current=1, maximum=5)
rows.append("two", current=2, maximum=5)
rows.append("three", current=3, maximum=5)
rows.append("four", current=4, maximum=5)
rows.append("five", current=5, maximum=5)
style = Style(show_fraction=True, show_percent=True)
print(rows.render(style))
…generates this string:
one █████████████████████████████████████████████████▍ 1 / 5 • 20%
two ██████████████████████████████████████████████████████████████████████████████████████████████████▊ 2 / 5 • 40%
three ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ 3 / 5 • 60%
four █████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ 4 / 5 • 80%
five ██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ 5 / 5 • 100%
Installation
progrow
requires Python 3.9 or later.
pip install progrow
Usage
Create a Rows
instance, and call append(name: str, current: float, maximum: float)
.
name
: Name.current
: Current progress value.maximum
: Maximum possible progress value.
To render the rows to a string, call render(style: Style)
. style
is optional, but supports:
Property | Description | Default |
---|---|---|
color |
Render in colour | True |
post_name |
String to inject after each row's name | " " |
show_fraction |
Include each row's fractional progress (<current> / <maximum> ) |
False |
show_percent |
Include each row's percentage progress | False |
width |
Width to draw | Terminal width |
Thank you! 🎉
My name is Cariad, and I'm an independent freelance DevOps engineer.
I'd love to spend more time working on projects like this, but--as a freelancer--my income is sporadic and I need to chase gigs that pay the rent.
If this project has value to you, please consider ☕️ sponsoring me. Sponsorships grant me time to work on your wants rather than someone else's.
Thank you! ❤️
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 Distributions
Built Distribution
Hashes for progrow-1.0.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e43bf3559f9025325bd89e98534adef9a96c38975868b7898095e6d6d1d1d1b |
|
MD5 | cb2002bcfc7e51a5059e276bc8cf9e33 |
|
BLAKE2b-256 | 3d80b401b77c409b4bfed3f9a1f7874c2237ffec00041c91971ae9ba4fb4640e |