Halo

0.0.31 · active · verified Sun Apr 12

Halo is a Python library that provides beautiful terminal spinners, offering visual feedback for long-running operations in command-line applications, IPython, and Jupyter. It is currently at version 0.0.31 and is actively maintained, though new releases are not frequent.

Warnings

Install

Imports

Quickstart

The `Halo` class is the primary interface for creating and managing terminal spinners. It can be used directly with `start()` and `stop()` methods, as a context manager (using `with` statement), or as a decorator. The context manager approach is generally recommended for clean resource management.

import time
from halo import Halo

# Basic usage with a 'with' statement for automatic start/stop and cleanup
with Halo(text='Loading data...', spinner='dots', color='cyan') as spinner:
    time.sleep(2) # Simulate a long-running operation
    spinner.succeed('Data loaded successfully!')

print("Application continues...")

view raw JSON →