Registry / devops / click-spinner

click-spinner

JSON →
library0.2.0pypypi✓ verified 25d ago

Click Spinner is a Python library that provides a simple context manager to display a spinning cursor in Click command-line interface (CLI) applications during long-running tasks where a precise progress bar isn't feasible. It aims to improve user experience by indicating activity. The library is currently at version 0.1.10 and is maintained as part of the `click-contrib` organization on GitHub.

pip install click-spinner
INSTALL
IMPORT
SIG · CLICK-SPINNER
C
click-spinner
devopspythonv0.2.0
Install
1.5s avg
Import
12ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.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.012s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.012s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

spinner
from click_spinner import spinner

Wrap your long-running code block within the `spinner()` context manager to automatically display and hide a spinning cursor.

import time from click_spinner import spinner def long_running_task(): """Simulates a task that takes some time.""" time.sleep(3) # Simulate 3 seconds of work print("Starting a long task...") with spinner(): long_running_task() print("Task completed!")
Debug
Known issues
gotchaSpinner characters are included in redirected stdout. When piping or redirecting the output of a command that uses `click-spinner` (e.g., `mycommand > output.txt`), the spinner characters will be written to the output file. This can interfere with machine-readable parsing or clean logs.
fix
There is no built-in mechanism to suppress the spinner when output is redirected. For machine-readable output, consider conditionally disabling the spinner or ensuring such commands do not use it.
affects: 0.1.1 to 0.1.10
gotchaIdentical versions 0.1.9 and 0.1.10 on PyPI. Due to PyPI issues, versions `0.1.9` and `0.1.10` of `click-spinner` are functionally identical. Users should not expect any differences or new features between these two specific releases.
fix
No action required, but be aware that upgrading from 0.1.9 to 0.1.10 will not introduce any changes.
affects: 0.1.9, 0.1.10
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'click_spinner'
The `click-spinner` library has not been installed in your Python environment or the environment where you are running your script.
fix
Install the package using pip: `pip install click-spinner`
ModuleNotFoundError: No module named 'click'
The `click` library, which `click-spinner` depends on, is not installed. Although `click-spinner` typically installs `click` as a dependency, sometimes `click` might be missing or installed in a different environment.
fix
Ensure the `click` dependency is installed: `pip install click` or `pip install click-spinner` to ensure all dependencies are met.
Spinning wheel characters are included in a redirected stdout
By default, `click-spinner` writes the spinning cursor to `sys.stdout`. When command-line output is redirected (e.g., to a file using `>` or piped to another command), the spinner characters are included in the redirected output, which is usually undesirable for machine-readable logs or pipes.
fix
Conditionally enable the spinner only when `sys.stdout` is connected to a TTY (interactive terminal).
```python
import sys
import time
import click_spinner

def long_running_task():
    time.sleep(3) # Simulate work

if __name__ == '__main__':
    # Check if stdout is a TTY before initializing the spinner
    if sys.stdout.isatty():
        with click_spinner.spinner():
            long_running_task()
    else:
        # Run without spinner if output is redirected
        long_running_task()
```
Upgrade
Version history
0.2.0latest on PyPI · released Jun 23, 2026
Audit
Dependencies
clickrequiredThis library is designed to integrate with Click CLI applications and implicitly expects Click to be installed.
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
click-spinner — pip install click-spinner · libregistry