
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Basic animated ASCII loaders for Python scripts. Python 2 & 3 compatible.
pip install pyloaders
git clone https://gitlab.com/ml394/pyloaders.git
cd pyloaders
python setup.py install
All loaders are declared by calling LoaderClass(<arguments>)
Option | Description | Type | Choices | Default | Valid For |
---|---|---|---|---|---|
text | Text displayed while loading | str | 'Loading' | Text, Spinning | |
size | Full width of loader | str | small, medium, large | 'medium' | Text, Bar, Progress |
character | ASCII value used in loader | str | . = * > ~ # @ $ + ! ? , | '.' / '=' | Text, Bar, Progress |
speed | Time between loader paints | float | .25 | Text, Spinning, Bar | |
duration | Runtime of fixed loader, in seconds | int | 10 | Text, Spinning, Bar | |
direction | Initial direction of moving loader | str | ltr, rtl | 'ltr' | Text, Bar |
animation | Continuous or oscillating movement | str | loop, bounce | 'loop' | Text, Bar |
colour | Terminal colour support required | str | blue, green, yellow, red | None | ALL |
style | Terminal styles support required | str | header, bold, underline | None | ALL |
complete_text | Text displayed after loader ends | str | 'Done!' | ALL | |
start | Progress loader start position | int | 0 | Progress | |
total | Progress loader total count | int | 100 | Progress |
Available Classes: SpinningLoader, TextLoader, BarLoader
Run as threads which can be started and stopped dynamically by you at any stage.
start()
method.stop()
method to terminate the thread.run()
method to run the loader for the set amount of time.from loaders import TextLoader
loader = TextLoader()
loader.start()
# Perform some tasks
loader.stop()
from loaders import TextLoader
fixed_loader = TextLoader(duration=10)
fixed_loader.run() # Pauses program execution and runs loader for 10s
Output
/ Loading... # SpinningLoader
.....Loading... # TextLoader
| ====== | # BarLoader
Remember: Don't try to start more than one loader at the same time!
Available Classes: ProgressLoader
Used to measure the completion progress of a loop or function.
When you initialize a ProgressLoader
object, you should specify the total number of iterations that will be performed in your loop as the total
argument.
On each iteration, call the loader's progress(n)
method, where n
is the current iteration count, to update the progress bar in the terminal.
from loaders import ProgressLoader
loader = ProgressLoader(total=10)
for i in range(10):
# Perform some task each loop
loader.progress(i)
Output
|========== | 50%
Remember: Don't print anything to the console while the loader is running!
New in version 0.0.5
You can now start a loader for shell commands
$ load some --shell command
[ ======== ]
There is a small test suite that uses the pytest module.
git clone https://gitlab.com/ml394/pyloaders.git
cd pyloaders
pip install -r requirements.txt
pytest
An visual example can be performed by running example.py
from the project directory.
This will run a suite of example loaders specified in the file for 5s each. By default, the indeterminate examples are run on fixed durations. To run them as threads, use the optional thread
argument.
# Fixed duration
python example.py
# Threaded
python example.py thread
To contribute to this project, clone master and create your own development branch.
git clone https://gitlab.com/ml394/pyloaders.git
git checkout -b <feature-name>
Push your branch remotely, and create a merge request to master so we can review your code.
If the merge request is approved, your new feature will be merged and pushed for the next release.
BTC donations (no matter how tiny) accepted at wallet address:
1PSWQrgbagNARvtum6pGS7rPUub4YiLmzX
FAQs
Basic animated ASCII loaders for Python scripts
We found that pyloaders demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.