Skip to main content

PyLoadBar

Loading sequence/progress bar generator with options for users to customize start/finish messages, toggle between bar/text sequences, and set total iterations among other features.


About

  • Useful for small intermittent pauses between console text returns, or visualizing the progress of a long-running process.

  • Users can choose between two different loading sequences:

    • A. Progress-bar style loading sequence
    • B. Animated-text style loading sequence
  • When instantiating a PyLoadBar object, you may set the type of loading sequence using the bar_sequence: bool parameter.

  • Once initialized, run the loading sequence using the start() method, and set sequence configuration using parameters.

  • Messages can be customized by passing custom strings to the msg_loading: str and msg_complete: str parameters respectively.

    • The loading message defaults to "Loading..."
    • The completion message defaults to "Done!"
  • You may apply a label to the progress bar using the label: str parameter (defaults to None).

    • NOTE: bar_sequence: bool must be set to True for a label to be assigned to the progress bar.

    • If bar_sequence: bool is False, the progress-bar sequence will not be used, and the animated text-based loading sequence will be used instead.

  • When calling the start() method and using the progress-bar sequence, the time taken to complete each iteration can be determined using the min_iter: float and max_iter: float parameters.

    • Each iteration length is randomized to a value between min_iter: float and max_iter: float seconds.
      • e.g. start(min_iter=0.5, max_iter=1.5) would take anywhere between 0.5 - 1.5 seconds to complete a single iteration.
  • The text-based loading sequence displays the loading message followed by incrementing dots, all printed to the same line.

    • Set number of seconds to complete a single text-sequence iteration using txt_iter_speed: float.
      • Defaults to 0.5 seconds per animation cycle.

Installing PyLoadBar

Using pip

Easiest method. Highly recommended over manual installation.

  • Run the following to install:

    pip install PyLoadBar
    
  • You should now be able to import PyLoadBar directly to your application.


Manual Installation

Not recommended.

1a. Download the latest source code .zip archive from the PyLoadBar GitHub releases page and extract contents to the desired location.

  • OR:

1b. Clone repository with the git client of your preference with:

gh repo clone schlopp96/PyLoadBar

2. Navigate to the directory containing extracted contents, and open said folder within a terminal.

3. Enter pip install -r requirements.txt to install all dependencies for this package.

4. Finally, move the "PyLoadBar-Vx.x.x" directory to your global Python 3rd-party package installation directory to be able to import PyLoadBar like any other module:

  • "~Python/Lib/site-packages/HERE"

5. Done!


Usage

  • PyLoadBar is very simple to use.

  • Within a .py project, simply import the PyLoadBar module to start using your custom loading sequence.

  • Example of standard loading sequence with label set to 'Solving':

      >>> from PyLoadBar import PyLoadBar
    
      >>> important_bar = PyLoadBar() # Initialize a new `PyLoadBar` instance.
    
      >>> important_bar.start(msg_loading='Important Stuff Happening', msg_complete='Day Saved!', label='Saving Day', min_iter=0.05, max_iter=1.0, iter_total=10) # Call `start` method to begin loading sequence.
    

    alt

  • Example of animated-text-based loading sequence:

      >>> from PyLoadBar import PyLoadBar
    
      >>> bar = PyLoadBar(bar_sequence=False) # Initialize loading sequence.
    
      >>> bar.start(msg_loading='Loading', msg_complete='Done!', iter_total=1, txt_iter_speed=1) # Start animated-text loading sequence.
    

    alt


Contact

  • If you have any questions, comments, or concerns that cannot be addressed through the project's GitHub repository, please feel free to contact me through my email address:

    • schloppdaddy@gmail.com

Metadata

Release files for PyLoadBar 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyLoadBar 0.2.0
File Size Uploaded
PyLoadBar-0.2.0.tar.gz 104.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyLoadBar 0.2.0
File Interpreter ABI Platform
PyLoadBar-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 123.4 kB

Release files / PyLoadBar-0.2.0.tar.gz

Download URL PyLoadBar-0.2.0.tar.gz
Size 104.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fe2fab576b7e23c10a20f273d29347ae7a0e5f4a38af0d52d30515478e122f79
BLAKE2b-256 checksum
How to use checksums
55dd13c76cb48af76f72cad449edfd42b8a6130fbaecc651d9238049311a4276
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.64.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.6

Release files / PyLoadBar-0.2.0-py3-none-any.whl

Download URL PyLoadBar-0.2.0-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4217e789aee26a636cada13f84bc5665b20ea44dfbaece6216d9b43729da5fdb
BLAKE2b-256 checksum
How to use checksums
9278485cd301d99a3a4f5ad960e59e96328c10f36456fda0cd466e861512faab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.64.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page