philiprehberger-cli-spinner
Dead-simple terminal spinners and progress indicators for CLI scripts.
Installation
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 |
Spinner.info(text) |
Stop with an info symbol |
Development
pip install -e .
python -m pytest tests/ -v
Support
If you find this project useful:
License
Release files for philiprehberger-cli-spinner 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| philiprehberger_cli_spinner-0.2.0.tar.gz | 6.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| philiprehberger_cli_spinner-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.6 kB
Release files / philiprehberger_cli_spinner-0.2.0.tar.gz
| Download URL | philiprehberger_cli_spinner-0.2.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fdd29f394c923bc004481c8d68ec445721518519454a1cd05a15f03552e4fa96
|
|
BLAKE2b-256 checksum How to use checksums |
f263906ca3eb4f8fb482ee8198e7f645e9f8158c5f89c4ebaf0ced44b0ac9a2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / philiprehberger_cli_spinner-0.2.0-py3-none-any.whl
| Download URL | philiprehberger_cli_spinner-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
832c4a73ce60203bfde95a0d6715ff2f79085b061d8e7834bfe65c8cc84e3009
|
|
BLAKE2b-256 checksum How to use checksums |
5f7c2c5e83fce70eff281b22e48e779b210dcbf6339f7800ac90391f5c7d21af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|