Registry / observability / ascii-colors

ascii-colors

JSON →
library0.11.25pypypi✓ verified 85d ago

A Python library for rich terminal output with advanced logging features. It provides functionalities for styling text, creating progress bars, and handling advanced terminal interactions. The current version is 0.11.21, with active development featuring regular updates.

pip install ascii-colors
INSTALL
IMPORT
SIG · ASCII-COLORS
A
ascii-colors
observabilitypythonv0.11.25
Install
1.9s avg
Import
159ms
Disk
21MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.11.25 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.134s · 25.4MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.9s · import 0.120s · 26MB
21MB installed
● package 21MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ascii_colors
import ascii_colors as ac
The library is commonly imported with an alias 'ac' for brevity when accessing its functions and color attributes.
ASCIIColors
from ascii_colors import ASCIIColors
The main class, though many common color functions are directly available from the module.

Demonstrates basic text coloring, style chaining, background/foreground combinations, and the integrated logging features. It also includes an example of ASCII art generation.

import ascii_colors as ac # Basic text coloring print(ac.red("This is red text.")) print(ac.green("This is green text.")) # Chaining styles (e.g., bold and blue) print(ac.bold + ac.blue("Bold blue text.") + ac.reset) # Background and foreground colors print(ac.bg_yellow + ac.black("Black text on a yellow background.") + ac.reset) # Using the advanced logging features ac.log_info("This is an informational message.") ac.log_warning("This is a warning message.") ac.log_error("This is an error message.") # Example of ASCII art (requires Pygments for complex fonts) # For simple fonts, it often works without complex dependencies. ac.print_ascii_art("Hello Registry!", font="slant")
Debug
Known issues
breakingThe `print_ascii_art` method was moved from being a method of the `ASCIIColors` class to a top-level function directly in the `ascii_colors` module.
fix
Change `ASCIIColors.print_ascii_art(...)` to `ascii_colors.print_ascii_art(...)` or `ac.print_ascii_art(...)` if you use `import ascii_colors as ac`.
affects: >=0.11.16
breakingSeveral logging configuration methods, such as `set_logging_level` and `set_level_colors`, were renamed or removed during the 0.11.x development cycle.
fix
Refer to the latest documentation or source code for the correct logging configuration methods, e.g., use `set_log_level` instead of `set_logging_level`.
affects: >=0.11.1
gotchaColor codes and ASCII art may display incorrectly or fill output with raw escape sequences when redirected to a file or piped to a non-terminal application, as `ascii-colors` assumes a TTY by default.
fix
Always ensure output is directed to a compatible terminal emulator. For logging to files, use the library's built-in logging system which can be configured to strip ANSI codes when output is not a terminal (e.g., `ascii_colors.set_log_file()`).
affects: All versions
Errors
Common errors & fixes
^[[31mThis is red text.^[[0m (or similar literal ANSI escape sequences)
The output is being redirected to a file, piped to another command, or viewed in an IDE terminal that does not interpret ANSI escape codes, leading to raw codes being printed.
fix
Ensure the output is directed to a compatible terminal emulator (e.g., Windows Terminal, iTerm2). When logging to files, use `ascii_colors.set_log_file()` to automatically strip codes or ensure your log formatters handle it.
AttributeError: type object 'ASCIIColors' has no attribute 'print_ascii_art'
The `print_ascii_art` method was moved from being a static method of the `ASCIIColors` class to a standalone function in the `ascii_colors` module in versions 0.11.16 and later.
fix
Update your code to call the function directly from the module: `ascii_colors.print_ascii_art(...)` (or `ac.print_ascii_art(...)` if using an alias).
Colors are not showing up in my terminal, only plain text.
Your terminal emulator does not support ANSI escape codes, or support is disabled. This is particularly common in older versions of Windows Command Prompt without additional tools or modern terminal applications.
fix
Use a modern terminal emulator (e.g., Windows Terminal, Alacritty, iTerm2, Kitty, GNOME Terminal). Verify your terminal's settings to ensure ANSI color code interpretation is enabled.
Upgrade
Version history
0.11.25latest on PyPI · released Jun 15, 2026
Audit
Dependencies
PygmentsrequiredRequired for some advanced features, particularly syntax highlighting and some ASCII art rendering.
Agent activity
49 hits · last 30 days
node
40
OpenAI (training)
1
Resources
ascii-colors — pip install ascii-colors · libregistry