{"library":"pygments-ansi-color","title":"Pygments ANSI Color","description":"Pygments ANSI Color (version 0.3.0) provides a Pygments lexer specifically designed to highlight ANSI escape codes for colors and styles. It allows Pygments to correctly render colored terminal output, making it readable and formatted. The library has a slow release cadence, with the last update in September 2022, but remains functional for its intended purpose.","language":"python","status":"maintenance","last_verified":"Fri Apr 17","install":{"commands":["pip install pygments-ansi-color"],"cli":null},"imports":["from pygments_ansi_color import AnsiColorLexer"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pygments import highlight\nfrom pygments.formatters import TerminalFormatter\nfrom pygments_ansi_color import AnsiColorLexer\n\n# Example string with ANSI color codes\nansi_string = \"\\u001b[31mError: Something went wrong!\\u001b[0m \\u001b[32mSuccess: Operation completed.\\u001b[0m\"\n\n# Highlight the string using AnsiColorLexer and output to terminal\nhighlighted_output = highlight(ansi_string, AnsiColorLexer(), TerminalFormatter())\n\nprint(highlighted_output)","lang":"python","description":"This quickstart demonstrates how to use `AnsiColorLexer` with Pygments' `highlight` function and `TerminalFormatter` to render a string containing ANSI color codes directly to your terminal. Ensure your terminal supports ANSI escape sequences for colors to display correctly.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}