ansimarkup
Produce colored terminal text with an xml-like markup
Decision gist · record as of 2026-08-14
Yes, if you need readable colored terminal output without managing raw escape codes. The low install friction, permissive license, stable classifier, and zero known vulnerabilities make it a safe choice. The aging maintenance status (last commit 191 days ago) is not a blocker for a stable, focused utility, but verify that its known limitations around unbalanced nesting don't affect your use case.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- On Windows, colorama.init() should be called first to enable ANSI escape sequence support.
- Low install friction with a single runtime dependency on colorama.
- The package is in aging maintenance status with a last commit on 2026-02-04, but carries a Production/Stable classifier and no known vulnerabilities.
License · maintenance · safety
permissive license (permissive) — Released under the BSD 3-Clause License (permissive), which allows commercial and private use with minimal restrictions—only requiring preservation of copyright notice and disclaimer.
last release 2026-02-04 (191 days) · last repo commit 2026-02-04 · 67 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 158,660 downloads/mo, #10,714 on PyPI
Alternatives
Verify before relying
from ansimarkup import parse, ansiprint
# Parse markup tags to ANSI escape sequences
result = parse("<b><r>bold red text</r></b>")
print(result)
# Or use ansiprint directly
ansiprint("<b><r>bold red text</r></b>")- Whether the package handles all edge cases beyond the 'happy paths' mentioned in its own limitations section.
- Current test coverage and whether corner cases like unbalanced nesting are adequately tested.
What it is and what it does
Ansimarkup is a lightweight wrapper around colorama that lets you write colored and styled terminal output using simple XML-like tags instead of raw ANSI escape codes. You write markup like `<b><red>text</red></b>` and it converts to the corresponding terminal escape sequences. It supports foreground and background colors (named, xterm, hex, and RGB), text styles like bold and dim, nested tags, custom tag definitions, and a logging formatter for the standard library.
The package is designed for convenience with a focus on keeping processing minimal. It includes utilities like ansistring for proper text alignment when using formatted strings, a strip() method to remove markup, and a strict mode to catch mismatched tags. It also works from the command line and on Windows (with colorama initialization). The main limitation is that it does little validation of markup structure—unbalanced nesting will produce incorrect output rather than raising an error.
Use it for
- Build CLI tools with colored help text, error messages, and status output using readable markup instead of escape codes.
- Add colored logging output to Python applications via the included AnsiMarkupFormatter for the logging module.
- Format terminal progress indicators, warnings, and alerts with different colors and styles for better visibility.
- Create shell-like scripts in Python that need readable, maintainable colored text without managing raw escape sequences.
- Align and format colored terminal tables or reports where the delta property helps account for escape sequence length.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need readable colored terminal output without managing raw escape codes.
The low install friction, permissive license, stable classifier, and zero known vulnerabilities make it a safe choice. The aging maintenance status (last commit 191 days ago) is not a blocker for a stable, focused utility, but verify that its known limitations around unbalanced nesting don't affect your use case.
Install
ansimarkup on PyPI
Before you install
Low install friction with a single runtime dependency on colorama. The package is in aging maintenance status with a last commit on 2026-02-04, but carries a Production/Stable classifier and no known vulnerabilities.
On Windows, colorama.init() should be called first to enable ANSI escape sequence support.
License in practice
Released under the BSD 3-Clause License (permissive), which allows commercial and private use with minimal restrictions—only requiring preservation of copyright notice and disclaimer.
Quickstart
from ansimarkup import parse, ansiprint
# Parse markup tags to ANSI escape sequences
result = parse("<b><r>bold red text</r></b>")
print(result)
# Or use ansiprint directly
ansiprint("<b><r>bold red text</r></b>")
Verify before relying
- Whether the package handles all edge cases beyond the 'happy paths' mentioned in its own limitations section.
- Current test coverage and whether corner cases like unbalanced nesting are adequately tested.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagecolorama |
| Maintenance | Aging 191 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 158,660 / month, #10,714 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Software Development :: Libraries |
Evidence: ansimarkup-2.2.0-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 colors markup”
- ansimarkupAnsimarkup converts XML-like markup tags into ANSI escape sequences…
- stySty provides a simple, customizable string styling markup for…
- ansi2htmlConverts terminal output with ANSI color codes to HTML or LaTeX,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also termcolor · ansicolors · ansi2html · simple-colors · ansi · ascii-colors · pastel · colorama · coloredlogs · pansi