Click Spinner

0.1.10 · active · verified Fri Apr 10

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.

Warnings

Install

Imports

Quickstart

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!")

view raw JSON →