ansi
ANSI cursor movement and graphics
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6 or later; terminal must support ANSI escape sequences for colors and effects to render.
- 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 · maintenance · safety
MIT License (permissive) — 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.
last release 2024-01-22 (935 days) · last repo commit 2024-01-22 · 53 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 103,553 downloads/mo, #12,799 on PyPI
Alternatives
Verify before relying
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)))- 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
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 on this page. Verify before relying on it.
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
ansi on PyPI
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.
Requires Python 3.6 or later; terminal must support ANSI escape sequences for colors and effects to render.
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)))
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 the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetyping-extensions |
| Maintenance | Dormant 935 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 103,553 / month, #12,799 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: ansi-0.3.7-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “terminal cursor movement”
- ansiProvides ANSI escape codes for cursor movement and text styling…
- wcwidthMeasures the displayed width of Unicode strings in terminals,…
- cursorHides or shows the terminal cursor in Python scripts on Linux and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Terminals packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Rich renders styled text, tables, progress bars, syntax highlighting, markdown, and tracebacks to the terminal with minimal code.
Colorama makes ANSI escape sequences for colored terminal text work on Windows by intercepting and converting them to win32 API calls, while passing through unchanged on other platforms.
Install it if you need colored terminal output to work on Windows or want to use ANSI-based libraries portably; skip it only if you target non-Windows platforms…
Measures the displayed width of Unicode strings in terminals, accounting for wide characters, combining marks, and terminal escape sequences that standard Python string functions mishandle.
Install it if your application formats text for terminals and handles non-ASCII characters.
Run a subprocess in a pseudo terminal (pty) and interact with its input and output, enabling automation of interactive programs that require terminal features like password prompts or curses-style interfaces.
However, note that it is aging (last release 2020-12-28) and not actively maintained; it works well for its narrow, well-defined purpose but won't receive updates for…
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
See also ansicolors · climage · colored · cursor · pansi · ansi2html · terminaltexteffects · strip-ansi · colorful · ansimarkup