Registry / devops / yaspin

yaspin

JSON →
library3.4.0pypypi✓ verified 23d ago

yaspin is a Python library that provides a simple and flexible way to display terminal spinners for CLI applications, indicating ongoing operations. It is currently at version 3.4.0 and maintains a regular release cadence, often updating with new features, dependency bumps, and Python version support.

pip install yaspin
INSTALL
IMPORT
SIG · YASPIN
Y
yaspin
devopspythonv3.4.0
Install
1.6s avg
Import
54ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.4.0 · 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.056s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.052s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

yaspin
from yaspin import yaspin
Spinner
from yaspin import Spinner
Used for creating custom spinners with specific frames and intervals.

The most common way to use yaspin is as a context manager, wrapping your time-consuming operations. You can customize the spinner type, text, and colors, and then finalize with success or failure indicators.

import time from yaspin import yaspin # Basic usage as a context manager with yaspin(text="Processing...") as sp: time.sleep(2) # Simulate work sp.ok("✔") # Mark as success # Example with custom spinner and colors from yaspin.spinners import Spinners with yaspin(Spinners.earth, text="Loading data...").white.on_blue as sp: time.sleep(3) if time.time() % 2 == 0: # Simulate a random outcome sp.fail("✘") # Mark as failure else: sp.ok("✨") # Mark with a sparkle
Debug
Known issues
breakingPython 3.8 and 3.9 support has been dropped in recent major versions. Yaspin v3.0.0 dropped Python 3.8, and v3.4.0 dropped Python 3.9. Ensure your environment uses Python 3.10 or newer.
fix
Upgrade your Python environment to 3.10 or a later supported version (3.10, 3.11, 3.12, 3.13, 3.14 are supported by v3.4.0).
affects: >=3.0.0, >=3.4.0
breakingVersion 3.0.0 introduced significant breaking changes, including the removal of previously exposed modules (base_spinner, helpers, signal_handlers) and constants (constants.COLOR_MAP).
fix
Review the official documentation for v3.0.0+ for updated API usage. Direct imports from these internal modules or reliance on COLOR_MAP will no longer work.
affects: >=3.0.0
deprecatedThe `is_jupyter()` method has been deprecated.
fix
Avoid using `is_jupyter()`. If you need to detect a Jupyter environment, consider alternative methods or check the yaspin documentation for recommended practices.
affects: >=3.3.0
gotchaWhile yaspin aims for 'pipe safety', early versions and certain terminal environments (especially on Windows) might exhibit issues where spinner control characters are visible when piping output to files or other programs.
fix
If encountering unwanted control characters in piped output, ensure you are on a recent `yaspin` version and consider using `sys.stdout.isatty()` checks in your code to conditionally disable `yaspin` or redirect its output to `sys.stderr` when `stdout` is not a TTY.
affects: <3.0.0 and potentially specific Windows terminals with newer versions
gotchaIntegrating yaspin with complex multithreaded applications might require careful synchronization to prevent display glitches or unexpected behavior, as multiple threads writing to the console can interfere with the spinner's output.
fix
If using yaspin in a multithreaded context, ensure that other threads do not write directly to `sys.stdout` while the spinner is active, or use `yaspin.write()` for thread-safe output. Consider using a `threading.Lock` to manage console access if conflicts arise.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'yaspin'
The `yaspin` library is not installed in the current Python environment.
fix
Install the library using pip:
`pip install yaspin`
AttributeError: module 'yaspin' has no attribute 'Spinner'
This error occurs when you import the `yaspin` module as `import yaspin` and then try to access the `Spinner` class using `yaspin.Spinner`. The name `yaspin` in this context refers to the convenience function provided by the library, not the module object containing the `Spinner` class.
fix
Import the `Spinner` class directly from the `yaspin` module:
`from yaspin import Spinner`
Or, use the `yaspin` convenience function if that was your intention:
`from yaspin import yaspin`
yaspin spinner not showing
The spinner animation typically requires a true TTY (teletypewriter) to render correctly. It often won't display in environments like some IDE output consoles (e.g., PyCharm's default run configuration) or when stdout is redirected, as these environments may not provide a full TTY.
fix
Run your Python script directly from a standard terminal emulator (like `cmd.exe`, PowerShell, bash, zsh) instead of an IDE's internal console. Ensure `sys.stdout.isatty()` returns `True` in your execution environment.
UnicodeEncodeError: 'charmap' codec can't encode character
This error often occurs in Windows terminals (e.g., `cmd.exe`) when the terminal's default encoding (like `cp1252` or `cp437`) cannot display the Unicode spinner characters used by `yaspin`.
fix
Change your terminal's encoding to UTF-8 using `chcp 65001` before running the Python script. Alternatively, configure `yaspin` to use an ASCII-only spinner set.
```bash
chcp 65001
python your_script.py
```
Or in Python:
```python
from yaspin import yaspin, SPHINX
with yaspin(spinner=SPHINX) as sp: # Use a simpler ASCII spinner
    sp.text = "Processing..."
```
Upgrade
Version history
3.4.0latest on PyPI · released Dec 6, 2025
Audit
Dependencies
termcolorrequiredProvides terminal colors, highlights, and attributes for customizing the spinner's appearance.
Agent activity
43 hits · last 30 days
node
38
OpenAI (training)
1
Resources
yaspin — pip install yaspin · libregistry