Skip to main content

A progress-bar designed to be useful and easy to use.

Project description

dashbar

A progress-bar designed to be useful and easy to use. dashbar-demo-preview

Usage

Firstly, you need to import dashbar.
It will be useful to import the time module as well

import dashbar, time

Iterating

To start dashbar, follow the example code below:

for i in dashbar.dash(10, dash_type="pipe", desc="example"):
    time.sleep(1/10) #completion after one second
    if i == 5:
        dashbar.status("half-way complete")

If the progress is large, the autodash function can be used, which adjusts the step count to fit the terminal.

for i in dashbar.autodash(10):
    time.sleep(1/10)
    if i == 8:
        dashbar.log("eighty percent complete")

Customizing dashbar

Dashbars can be customized by the following code:

dashbar.customize(element="filler", value=" ")

List of dashbars:

  • classic
  • arrow
  • box
  • circle_charger
  • box_charger
  • striped
  • dollar
  • box_shade
  • pipe
  • custom

List of dashbar elements:

  • start
  • head
  • trail
  • filler
  • finish

Building a Dashbar

Dashbars can be built via the Build class.

bar = dashbar.Build(10, "box_shade")
for i in range(100):
    if i%10 == 0:
        bar.update(1, display=True)
    time.sleep(1/20) #completion after five seconds

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

dashbar-1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dashbar-1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file dashbar-1.0.tar.gz.

File metadata

  • Download URL: dashbar-1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for dashbar-1.0.tar.gz
Algorithm Hash digest
SHA256 8e53c18d285dc22e246a016a29a838aafcc9ab342f5071b31a2f846de683122a
MD5 4d8ed7be8717f4e2ac552ac0bd818a53
BLAKE2b-256 0384cd5a33f71f94be9e77a51fe54f42f47bf50488b9a2b009d41af39b2221b8

See more details on using hashes here.

File details

Details for the file dashbar-1.0-py3-none-any.whl.

File metadata

  • Download URL: dashbar-1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for dashbar-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82a45b8f0925e8f1449c32d62fd229ed82ee0268496ca318a4d4088927a524b6
MD5 c63534c5b62ed0dab5e627e760a51f1b
BLAKE2b-256 a513afa68c7c513e2c24210d318010bd8dfa7877a2e715d2eddfd5d9fbe18374

See more details on using hashes here.

Supported by

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