Skip to main content

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%

progrow example

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

progrow-1.0.0a1-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page