Simple, easy-to-use loading sequence/progress bar module.
Project description
PyLoadBar
Simple, easy-to-use loading sequence module.
About
-
Useful for small intermittant pauses between console text returns, or code actions.
-
Customizable, optional loading and completion messages available to print to the console.
- Loading message defaults to
"Loading..."
. - Completion message defaults to
"Done!"
.
- Loading message defaults to
-
Includes an optional progress bar (simply change the
enable_display: bool
parameter to equalFalse
if you wish to disable the progress bar), toggled on by default.
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.
-
Download source code from the PyLoadBar GitHub repo.
-
Extract contents of the containing
**.zip
file to desired install location. -
Navigate to directory containing extracted contents, and open said folder within a terminal.
-
Enter
pip install -r requirements.txt
to install all dependencies for this package. -
Finally, move the
"PyLoadBar-vx.x.x"
diretory to your global Python 3rd-party package installation directory to be able to importPyLoadBar
like any other module:"path/to/python/Lib/site-packages/here"
-
Done!
Usage
-
Within a
.py
project, simply import thePyLoadBar
module to start using your custom loading sequence. -
PyLoadBar
is very simple to use.- For example, try running the following:
from PyLoadBar import load
def add50(x):
load(f'Adding 50 to {x}', 'Okay!\n')
return x + 50
print(add50(50))
- This will return:
Solving...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 8.94it/s].
Okay!
100
-
Of course, the loading and loading complete messages can be customized by passing custom strings to the
msg_loading: str
andmsg_complete: str
parameters respectively. -
Note that the progress bar can be toggled using the
enable_display: bool
parameter within theload(msg_complete: str, msg_loading: str, time: int, enable_display: bool)
method. -
The time taken to completely fill the progress bar can be determined using the
time: int
parameter.- Every 10 units = 1 second.
- e.g.
load(time=5)
(default) would take 0.5 seconds to fill the progress bar.
- e.g.
- Every 10 units = 1 second.
-
You may also label the progress bar with the
label: str
parameter, defaults toNone
. -
Example:
>>> from PyLoadBar import load >>> load('Important Stuff Happening', 'Day Saved!', 50, 'Saving Day') Important Stuff Happening... Saving Day: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [00:05<00:00, 9.19it/s] Day Saved!
Contributing to PyLoadBar
- If you wish to help contribute to this project, along with the tools you need to develop and run tests, please run the following in your virtual env:
pip install PyLoadBar[dev]
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
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 Distribution
Built Distribution
File details
Details for the file PyLoadBar-0.0.7.1.tar.gz
.
File metadata
- Download URL: PyLoadBar-0.0.7.1.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using 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.62.3 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d865694411b6353093b5302d29686f5c26591bead2cda96defba2fbd16e452fd |
|
MD5 | 0e2b03ff43992cd68f594cec96b7a9e0 |
|
BLAKE2b-256 | 9a81ce11b29a27755b42607fb36b8e67ebba47687097f2428e3a1bfde5f0fda0 |
Provenance
File details
Details for the file PyLoadBar-0.0.7.1-py3-none-any.whl
.
File metadata
- Download URL: PyLoadBar-0.0.7.1-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using 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.62.3 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d866c5b6ea36e5d4f460aa905d1a049bbcbeda6f482f72ba91bca9212c0579c4 |
|
MD5 | 474f13ef4fbc449fad62cf2ba94ea415 |
|
BLAKE2b-256 | 77bdc2aff1054c635b799d33e555ad6bb850295faa17b9df0d53aab04775f9f2 |