Skip to main content

Python package to easily create a statusbar that can be modified and expanded with pythons formatted strings

Project description

statusbar

Python package that enables the easy creation of a statusbar. The creation of a statusbar utilizes pythons formatted strings to easily create custom bars that can be updated in an asyncronous manner. This project is designed to be lightweight and thus requires no additional packages.

Installation

python3 -m pip install pystatusbar

From source

git clone https://github.com/lukaswd/statusbar.git
cd statusbar
python3 -m pip install .

Example Usage

import time

from pystatusbar import StatusBar

if __name__ == '__main__':
    format_start = " This is a test {WORD}bar with lines: {i}"
    format_end = " {time} "

    bar = StatusBar(format_start=format_start, format_end=format_end, i=0, WORD="")
    bar.start()
    for i in range(50):
        print(f"Test Line {i}")
        if i % 10 == 0:
            bar.update(i=i)

        if i == 25:
            bar.update(WORD="status")

        time.sleep(0.1)
    bar.stop()

With the output:

Test Line 0
Test Line 1
Test Line 2
Test Line 3
Test Line 4
Test Line 5
Test Line 6
Test Line 7
Test Line 8
Test Line 9
Test Line 10
Test Line 11
 This is a test bar with lines: 10                         1.2s 

The bar also works with sys.stdout.write and the python logging library

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

pystatusbar-0.0.5.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

pystatusbar-0.0.5-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file pystatusbar-0.0.5.tar.gz.

File metadata

  • Download URL: pystatusbar-0.0.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for pystatusbar-0.0.5.tar.gz
Algorithm Hash digest
SHA256 add2020178f6c0aac3f91b2297d5331ce4919639fc28523dcf8b8bb2ae3bc546
MD5 5eb56ea8cc92f764b81cee201e908f1e
BLAKE2b-256 acd424d863f9f5cf78cfc8edaef3dee4795766c3b0b198540522b1f71547e36f

See more details on using hashes here.

File details

Details for the file pystatusbar-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: pystatusbar-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for pystatusbar-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 22e0f551b795e6c727eb5db4675a9bfae65ba688ca994c0a3bd629438e1d5a7f
MD5 e1f2e21df313da3c390de8493393b794
BLAKE2b-256 0fda738007cc2d211f95ad25841b196f4b6d739d56bae7615610d03a0273be75

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