{"id":2365,"library":"yaspin","title":"Yet Another Terminal Spinner","description":"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.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/pavdmyt/yaspin","tags":["terminal","spinner","CLI","progress","animation","console"],"install":[{"cmd":"pip install yaspin","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Provides terminal colors, highlights, and attributes for customizing the spinner's appearance.","package":"termcolor","optional":false}],"imports":[{"symbol":"yaspin","correct":"from yaspin import yaspin"},{"note":"Used for creating custom spinners with specific frames and intervals.","symbol":"Spinner","correct":"from yaspin import Spinner"}],"quickstart":{"code":"import time\nfrom yaspin import yaspin\n\n# Basic usage as a context manager\nwith yaspin(text=\"Processing...\") as sp:\n    time.sleep(2) # Simulate work\n    sp.ok(\"✔\") # Mark as success\n\n# Example with custom spinner and colors\nfrom yaspin.spinners import Spinners\n\nwith yaspin(Spinners.earth, text=\"Loading data...\").white.on_blue as sp:\n    time.sleep(3)\n    if time.time() % 2 == 0: # Simulate a random outcome\n        sp.fail(\"✘\") # Mark as failure\n    else:\n        sp.ok(\"✨\") # Mark with a sparkle","lang":"python","description":"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."},"warnings":[{"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).","message":"Python 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.","severity":"breaking","affected_versions":">=3.0.0, >=3.4.0"},{"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.","message":"Version 3.0.0 introduced significant breaking changes, including the removal of previously exposed modules (base_spinner, helpers, signal_handlers) and constants (constants.COLOR_MAP).","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Avoid using `is_jupyter()`. If you need to detect a Jupyter environment, consider alternative methods or check the yaspin documentation for recommended practices.","message":"The `is_jupyter()` method has been deprecated.","severity":"deprecated","affected_versions":">=3.3.0"},{"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.","message":"While 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.","severity":"gotcha","affected_versions":"<3.0.0 and potentially specific Windows terminals with newer versions"},{"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.","message":"Integrating 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}