pysnurr

A beautiful terminal spinner library for Python. Provides non-blocking spinner animations at the current cursor position.
Installation
pip install pysnurr
Usage
from pysnurr import Snurr, SPINNERS
import time
with Snurr() as spinner:
spinner.status = "Working..."
time.sleep(2)
spinner = Snurr()
spinner.start()
spinner.status = "Processing..."
time.sleep(2)
spinner.stop()
spinner = Snurr(frames=SPINNERS["CLASSIC"])
spinner = Snurr(frames=SPINNERS["EARTH"])
spinner = Snurr(frames=SPINNERS["HEARTS"])
spinner = Snurr(frames=SPINNERS["MOON"])
...
print("Processing", end="")
with Snurr() as spinner:
time.sleep(2)
print(" Done!")
with Snurr(status="Starting up...") as spinner:
time.sleep(1)
spinner.status = "Processing..."
time.sleep(1)
with Snurr(frames=SPINNERS["EARTH"]) as spinner:
spinner.status = "Starting a long process..."
time.sleep(1)
spinner.status = "Step 1: Data processing"
time.sleep(1)
spinner.status = "Step 2: Analysis complete"
Features
- Non-blocking animation
- Dynamic status messages
- Multiple built-in spinner styles:
CLASSIC
: Classic ASCII spinner (/-|)
ARROWS
: Arrow rotation (ββββββββ)
BAR
: ASCII loading bar (βββββ
ββββββ
ββββ)
BLOCKS
: Minimal blocks (ββββ)
DOTS_BOUNCE
: Bouncing dots (.oOα€Β°α€Oo.)
EARTH
: Earth rotation (πππ)
HEARTS
: Colorful hearts (ππππ)
MOON
: Moon phases (ππππππππ)
SPARKLES
: Sparkling animation (β¨βοΈπ«)
TRIANGLES
: Rotating triangles (β’β£β€β₯)
WAVE
: Wave pattern (βΊβ»βΌβ½βΌβ»)
- Cursor hiding during animation
- Thread-safe status updates
- Flexible positioning at current cursor position
- Python 3.10+ support
Development
Clone the repository and install in development mode with all development dependencies:
git clone https://github.com/dewe/pysnurr.git
cd pysnurr
make dev-install
Run tests and checks:
make test
make lint
License
This project is licensed under the MIT License - see the LICENSE file for details.