Skip to main content

philiprehberger-cli-spinner

Tests PyPI version Last updated

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:

⭐ Star the repo

🐛 Report issues

💡 Suggest features

❤️ Sponsor development

🌐 All Open Source Projects

💻 GitHub Profile

🔗 LinkedIn Profile

License

MIT

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)

Source distribution for philiprehberger-cli-spinner 0.2.0
File Size Uploaded
philiprehberger_cli_spinner-0.2.0.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for philiprehberger-cli-spinner 0.2.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page