--- id: ansimarkup version: "2.2.0" license: BSD 3-Clause License Copyright (c) 2017, Georgi Valkov. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following… (full text in the JSON record) license_treatment: permissive maintenance: aging --- # ansimarkup — Produce colored terminal text with an xml-like markup License: permissive · Maintenance: aging · Downloads: 158.7K/mo ## 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 `text` 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 above — verify before relying. Ansimarkup converts XML-like markup tags into ANSI escape sequences for colored and styled terminal text output. 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 pip install ansimarkup uv add ansimarkup poetry add ansimarkup ## Installing ansimarkup 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. 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("bold red text") print(result) # Or use ansiprint directly ansiprint("bold red text") On Windows, colorama.init() should be called first to enable ANSI escape sequence support. 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: BSD 3-Clause License Copyright (c) 2017, Georgi Valkov. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 158.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags terminal colors markup, ansi escape sequences, colored terminal text, terminal styling, command line colors, xml markup terminal, terminal formatting, terminal-ui, cli-formatting [View on SkillFed](https://skillfed.io/packages/ansimarkup) · [View on PyPI](https://pypi.org/project/ansimarkup/)