{"id":23249,"library":"ansi","title":"ANSI - ANSI Cursor Movement and Graphics","description":"A lightweight Python library for producing ANSI terminal control sequences, including cursor movement, color (8-bit and 24-bit True Color), and graphics. Current stable version is 0.3.7, released in October 2023. Maintenance mode; infrequent releases.","status":"maintenance","version":"0.3.7","language":"python","source_language":"en","source_url":"https://github.com/tehmaze/ansi","tags":["ansi","terminal","cursor","color"],"install":[{"cmd":"pip install ansi","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Cursor is re-exported from top-level module","wrong":"from ansi.cursor import Cursor","symbol":"Cursor","correct":"from ansi import Cursor"},{"note":"Fore is re-exported; import from top-level for simplicity","wrong":"from ansi.color import Fore","symbol":"Fore","correct":"from ansi import Fore"}],"quickstart":{"code":"from ansi import Cursor, Fore, EscapeCode\n\ncursor = Cursor()\nprint(cursor.up(1) + Fore.RED + 'Hello in red' + Fore.RESET)","lang":"python","description":"Move cursor up one line and print red text, then reset color."},"warnings":[{"fix":"Ensure Python >=3.7; pass integers to rgb(), e.g., rgb(255,0,0) not rgb('255','0','0')","message":"Python 2 and Python <3.7 are no longer supported. The rgb() function only accepts integers, not strings.","severity":"deprecated","affected_versions":">=0.3.1"},{"fix":"Add Fore.RESET or Cursor.RESET after your output, or use context managers if available.","message":"The package does not automatically reset terminal attributes; you must explicitly use RESET codes.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from ansi.cursor import Cursor' or upgrade to >=0.3.5 where the fix is applied.","cause":"The top-level __init__.py does not import Cursor by default in some older versions.","error":"AttributeError: module 'ansi' has no attribute 'Cursor'"},{"fix":"Upgrade to latest version: pip install --upgrade ansi","cause":"Fore is not available in very old versions (pre-0.3.0).","error":"ImportError: cannot import name 'Fore' from 'ansi'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}