Registry / serialization / halo
library0.0.31pypypi✓ verified 22d ago

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.

pip install halo
INSTALL
IMPORT
SIG · HALO
H
halo
serializationpythonv0.0.31
Install
2.6s avg
Import
72ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.31 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.068s · 19.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.6s · import 0.076s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Halo
from halo import Halo

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...")
Debug
Known issues
deprecatedThe library internally uses `threading.Thread.setDaemon`, which has been deprecated in Python 3.10 in favor of setting the `daemon` attribute directly. This may lead to deprecation warnings or unexpected behavior in newer Python environments.
fix
No direct fix for users; requires library update. Monitor GitHub issues for resolution.
affects: 0.0.31 and older (Python 3.10+ environments)
breakingThere is an open bug where using text animations and then switching to a new message that is shorter than the current animated text can cause a crash.
fix
Avoid changing animated text to a significantly shorter string, or ensure animations are stopped before text changes, particularly if crashes are observed.
affects: All versions up to 0.0.31
gotchaOn Windows operating systems, the default spinner might be 'line' instead of the commonly shown 'dots' spinner due to terminal compatibility. Users should explicitly specify `spinner='dots'` if they want that animation on Windows.
fix
Initialize `Halo` with `spinner='dots'` (or another desired spinner) explicitly: `Halo(..., spinner='dots')`.
affects: All versions
gotchaText provided to the `Halo` spinner may incorrectly ignore leading spaces, which can affect precise formatting and alignment in the terminal.
fix
If leading spaces are critical, consider pre-padding the terminal output or using alternative methods for alignment rather than relying on `Halo`'s text parameter for leading spaces.
affects: All versions up to 0.0.31
gotchaHalo spinners may not render correctly or appear at all in certain continuous integration (CI/CD) environments, such as Jenkins, due to terminal emulation differences.
fix
Test terminal output in your specific CI environment. Consider disabling spinners (`enabled=False`) in CI environments if display issues occur, or check for CI-specific configuration options.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'halo'
The 'halo' library has not been installed in the Python environment being used, or the environment where it was installed is not active.
fix
Install the library using pip: `pip install halo`. If using a virtual environment, ensure it is activated before installation and execution.
Halo not displaying/working in Jupyter Notebooks
Halo's terminal-based spinner functionality often conflicts with the way Jupyter Notebooks handle stdout and real-time cursor manipulation, leading to the spinner not appearing or output being improperly cleared. A specific error 'Halo.__init__.<locals>.clean_up() takes 0 positional arguments but 1 was given' can occur with newer IPython versions.
fix
While `halo` has some built-in compatibility, for robust spinner display in Jupyter, consider using libraries specifically designed for notebook environments like `tqdm.notebook` or implement custom `ipywidgets.Output` handling. The issue 'clean_up() takes 0 positional arguments' is a known bug with newer ipython versions (e.g., >8.16.1) and may require downgrading ipython or waiting for a fix in `halo`.
Other Halo spinners can't load / Halo not working on Windows (often defaults to 'line' spinner)
Halo's rich spinner animations rely on certain terminal capabilities that are often not fully supported or behave differently on Windows operating systems compared to Unix-like systems. This can cause fancier spinners to not render correctly or the library to fall back to a basic 'line' spinner.
fix
While `halo` attempts to detect support, a direct fix for all spinners on Windows is not always available due to fundamental terminal differences. Ensure your terminal emulator (e.g., Windows Terminal, VS Code integrated terminal) is up-to-date. For a consistent experience across platforms, stick to the default 'dots' or 'line' spinner if encountering issues, or consider using `halo` only in environments where full terminal support is expected.
Upgrade
Version history
0.0.31latest on PyPI · released Nov 10, 2020
Audit
Dependencies
coloramaoptionalUsed for cross-platform terminal coloring, especially on Windows, though not explicitly listed as a PyPI dependency.
Agent activity
13 hits · last 30 days
node
12
Resources
halo — pip install halo · libregistry