Dead-simple terminal spinners and progress indicators for CLI scripts
Project description
philiprehberger-cli-spinner
Dead-simple terminal spinners and progress indicators for CLI scripts.
Install
pip install philiprehberger-cli-spinner
Usage
from philiprehberger_cli_spinner import spinner
with spinner("Loading data"):
do_work()
Finish with status
from philiprehberger_cli_spinner import spinner
s = spinner("Deploying")
s.start()
try:
deploy()
s.succeed("Deployed successfully")
except Exception:
s.fail("Deploy failed")
Decorator
from philiprehberger_cli_spinner import spin
@spin("Computing")
def heavy_task():
...
Update text
from philiprehberger_cli_spinner import spinner
with spinner("Step 1") as s:
step_one()
s.update("Step 2")
step_two()
Styles
Five built-in animation styles are available:
from philiprehberger_cli_spinner import spinner
with spinner("Working", style="braille"):
do_work()
Available styles: dots, line, bounce, braille, arrow.
API
| Function / Method | Description |
|---|---|
spinner(text, *, style) |
Create a Spinner (context manager) |
spin(text, *, style) |
Decorator that shows a spinner during execution |
Spinner.start() |
Start the spinner animation |
Spinner.stop() |
Stop the spinner and clear the line |
Spinner.update(text) |
Change the displayed text |
Spinner.succeed(text) |
Stop with a success symbol |
Spinner.fail(text) |
Stop with a failure symbol |
Spinner.warn(text) |
Stop with a warning symbol |
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file philiprehberger_cli_spinner-0.1.2.tar.gz.
File metadata
- Download URL: philiprehberger_cli_spinner-0.1.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84d4266de540f641f23c1db5c81dfc484585379a8ee899f2214c4801f9979d11
|
|
| MD5 |
3cb6afbe1eb63780a2b7f20f94195fba
|
|
| BLAKE2b-256 |
58b1c0b3cf269c5aed2d30e3c0f92962153ea483a703fffb3660ac6faf560cbf
|
File details
Details for the file philiprehberger_cli_spinner-0.1.2-py3-none-any.whl.
File metadata
- Download URL: philiprehberger_cli_spinner-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8fa66c91c76bce6f99c1885af0c5a9d74e793000e9fa6c5a751d9a28d8e7571
|
|
| MD5 |
8d8405326891d60c448a9e0e24574c9b
|
|
| BLAKE2b-256 |
65d64971e7c0ead496d8da389f96e53af3037abfaaf6a03dc34a231f3d69389b
|