--- id: ansi version: "0.3.7" license: MIT License license_treatment: permissive maintenance: dormant --- # ansi — ANSI cursor movement and graphics License: permissive · Maintenance: dormant · Downloads: 103.6K/mo ## What it is and what it does ANSI is a small library that wraps ANSI escape codes—the standard sequences terminals use to move the cursor, change text color, apply effects like bold or underline, and control other display attributes. It lets you build styled terminal output by composing color and effect objects, either as a sequence of strings to join or through a functional syntax where colors wrap text as callables. The package supports standard ANSI colors (foreground and background), text effects (reset, bold, etc.), and 256-color RGB mode for finer color control. It offers both British and American English module names (ansi.colour and ansi.color). With only typing-extensions as a dependency and a pure-Python wheel, it installs with minimal friction and works on any Python 3.6+ environment with a terminal that understands ANSI codes. Use it for: - Add colored and styled output to CLI tools and scripts without external dependencies. - Build terminal-based user interfaces with cursor positioning and text effects. - Highlight errors, warnings, and status messages in console applications. - Generate colored log output for debugging and monitoring scripts. - Create visually distinct sections in terminal reports or data displays. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides ANSI escape codes for cursor movement and text styling (colors, effects) in terminal output, with support for 256 RGB colors and both British and American English naming. Yes, if you need ANSI terminal styling in a CLI tool or script. The package is lightweight, has no security issues, and carries a permissive license. Its dormant maintenance is not a blocker for stable, narrow functionality like ANSI code generation, but verify that the codes work reliably with your target terminals before relying on it for critical output. ## Install pip install ansi uv add ansi poetry add ansi ## Installing ansi Before you install: Low friction: pure Python wheel with only typing-extensions as a runtime dependency. Dormant maintenance (last commit 2024-01-22, 935 days since release), but repository is not archived and has seen recent activity. License in practice: MIT License permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you retain the license notice. Quickstart: pip install ansi from ansi.colour import fg, bg from ansi.colour.fx import reset msg = (bg.red, fg.yellow, 'Hello world!', reset) print(''.join(map(str, msg))) Requires Python 3.6 or later; terminal must support ANSI escape sequences for colors and effects to render. Verify before relying: - Whether the package is actively maintained or if dormancy signals upcoming deprecation - Compatibility with modern terminal emulators and whether all ANSI codes work reliably across platforms ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 103.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags ansi escape codes terminal, colored text console output, terminal cursor movement, ansi color codes python, 256 rgb terminal colors, terminal text styling, ansi graphics codes, terminal-styling, ansi-codes [View on SkillFed](https://skillfed.io/packages/ansi) · [View on PyPI](https://pypi.org/project/ansi/)