Skip to main content

Pre-built Unicode braille spinner animations as raw frame data

Project description

unicode-animations

Python port of gunnargray-dev/unicode-animations.

18 pre-built Unicode braille spinner animations, a ready-to-use live_spinner context manager for CLI apps, and grid utilities for building custom spinners. Zero dependencies — stdlib only.

Install

uv add unicode-animations

Quick start

from unicode_animations import live_spinner
import time

with live_spinner("helix", text="Loading...", color="cyan"):
    time.sleep(3)

Usage

Live spinner for CLI apps

LiveSpinner runs animation in a background thread and cleans up automatically:

from unicode_animations import live_spinner

# As a context manager
with live_spinner("dna", text="Downloading...", color="green"):
    do_work()

# Manual control
from unicode_animations import LiveSpinner

sp = LiveSpinner("helix", text="Processing...", color="cyan")
sp.start()
# ... do work ...
sp.stop(symbol="✓")  # stop with a final symbol

Parameters:

Parameter Type Default Description
name_or_spinner str | Spinner required A spinner name or a Spinner instance
text str "" Status text shown next to the spinner
color str | None None ANSI color: red, green, yellow, blue, magenta, cyan, white
stream IO[str] | None stderr Output stream (non-TTY streams get a text-only fallback)
scale int 1 Scale factor (2 or 3) for bigger rendering

Raw frame data

from unicode_animations import spinners

spinner = spinners["helix"]
print(spinner.frames)    # tuple of animation frames
print(spinner.interval)  # ms between frames

Custom spinners with the grid API

from unicode_animations import make_grid, grid_to_braille, braille_to_grid

grid = make_grid(4, 2)   # 4 rows x 2 cols (one braille char)
grid[0][0] = True
grid[3][1] = True
print(grid_to_braille(grid))  # ⡁

# Decode back to grid
grid = braille_to_grid("⡁")
print(grid[0][0])  # True

Scaling spinners

from unicode_animations import spinners, scale_spinner

big = scale_spinner(spinners["helix"], factor=2)  # 2x bigger
print(big.frames[0])  # multi-line braille output

CLI demo

python -m unicode_animations                          # cycle through all
python -m unicode_animations helix                    # preview one
python -m unicode_animations helix --color cyan       # with color
python -m unicode_animations helix --scale 2          # bigger
python -m unicode_animations --list                   # list all names
python -m unicode_animations --list --scale 2         # list with scaled samples
python -m unicode_animations --duration 5             # set preview duration

Available spinners

braille · braillewave · dna · scan · rain · scanline · pulse · snake · sparkle · cascade · columns · orbit · breathe · waverows · checkerboard · helix · fillsweep · diagswipe

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

unicode_animations-0.2.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unicode_animations-0.2.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file unicode_animations-0.2.0.tar.gz.

File metadata

  • Download URL: unicode_animations-0.2.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.1

File hashes

Hashes for unicode_animations-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7613ff3475a86115477e638f4f9b84b3c70f7789c7199ec1a1e1d4e1be95b1fa
MD5 479a6f3c6a629d5b2156428b10beebdf
BLAKE2b-256 914f6b9977051677c842da79bfe65770d998d024bccd141835a9aaaf236fc3d3

See more details on using hashes here.

File details

Details for the file unicode_animations-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for unicode_animations-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d34c17d0568568eab774baca7e6566f9f5879b9c49a1749aca526173716e15f1
MD5 686e9a7f08490f6a2c41e079b9e68083
BLAKE2b-256 5834287c6d0501b62f762e79b636b5f9f8de3ac7f9bb75dfc54f221293b2e7a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page