a CLI based loading spinner.
Project description
loadspinner
A CLI based loading spinner which is used to tell the user work is being done in the background.
Loadspinner contains more than 20 spinners to choose from, and you can even create your own spinner.
Prerequisites
- Terminal that accepts ANSI codes
Usage
Creating a spinner:
import loadspinner
spinner = loadspinner.Spinner(spinner_type="classic")
Starting the spinner:
spinner.start() # starts the spinner
spinner.stop() # stops the spinner
[!HINT] You can also assign a timer to spinners, e.g.
spinner.start(5)
will stop the spinner after 5 seconds.
Usage with context managers:
import loadspinner
with loadspinner.Spinner("newton"):
input("press enter to stop ")
Usage with decorators:
from loadspinner import functionSpinner
@functionSpinner("building")
def doWork():
# code...
doWork()
Spinners can be made or customized:
import loadspinner
loadspinner.makeSpinner(
name="myCustomSpinner",
frames=["a", "b", "c", "1", "2", "3"],
interval=200,
)
The above code will create its own spinner which can be accessed as its own name, e.g. loadspinner.Spinner("myCustomSpinner")
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
Built Distribution
File details
Details for the file loadspinner-0.6.tar.gz
.
File metadata
- Download URL: loadspinner-0.6.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | add72f1fd5016900bc69acbe0079c9ff328953a1f6080a567afd01ac679ac6f7 |
|
MD5 | ed7961a12e3819ddbf204b44227008f7 |
|
BLAKE2b-256 | d77a22c0a36a9bf01d38a39c57b58f39978e96fab29b9a2dabecb51c97b3beec |
File details
Details for the file loadspinner-0.6-py3-none-any.whl
.
File metadata
- Download URL: loadspinner-0.6-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 882fa55183df3b5afbe96b04dff724c9f4d2795199ba8dd2cb7cfa93e9f3a03b |
|
MD5 | 656c1df04ac8af6368115805ff1ac0f7 |
|
BLAKE2b-256 | 209141befec182ffad82ca53848bb09e66e721b20c293b2590c90f78d383cdbd |