--- id: colorclass version: "2.2.2" license: MIT license_treatment: permissive maintenance: abandoned --- # colorclass — Colorful worry-free console applications for Linux, Mac OS X, and Windows. License: permissive · Maintenance: abandoned · Downloads: 9.1M/mo ## What it is and what it does colorclass is a library for adding ANSI color codes to console text in Python, with built-in support for automatic color selection based on terminal background brightness. It works by subclassing str (Python 3.x) or unicode (Python 2.x) and provides tag-based syntax like {red}text{/red} to mark colored regions. The library includes platform-specific initialization—Windows.enable() for Windows, set_light_background() or set_dark_background() for Linux/macOS—to enable automatic color detection and adjustment. The package is designed for developers building command-line applications that need portable, readable color output across different terminal environments. It handles the complexity of terminal capability detection and provides helper attributes to access both colored and plain-text versions of strings. However, the project is archived and unmaintained since 2021-12-09, with no active development or security updates. Use it for: - Add colored output to CLI tools and scripts that run on multiple platforms without manual ANSI code management. - Build terminal-based applications that automatically adapt text colors to dark or light terminal backgrounds. - Pipe colored or ANSI-coded text through Python for processing, stripping, or forcing color output via environment variables. - Create cross-platform shell utilities in Python that display error/warning/success messages in distinct colors. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides ANSI color text output for console applications with automatic color selection based on terminal background (dark or light) across Linux, macOS, and Windows. Yes, if you need basic ANSI color support in a stable, mature codebase and can accept no further maintenance. The library is production-stable and has no known vulnerabilities, but its abandonment since 2021-12-09 means no fixes for future Python versions or terminal changes. For new projects, consider actively maintained alternatives; for existing codebases already using it, the low install friction and lack of dependencies make it safe to keep. ## Install pip install colorclass uv add colorclass poetry add colorclass ## Installing colorclass Before you install: Installation is straightforward with no runtime dependencies. However, the package is archived and abandoned—last release was 2021-12-09, with no active maintenance or security updates expected. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions, making it safe for commercial and open-source projects. Quickstart: pip install colorclass from colorclass import Color color_string = Color('{red}Test{/red}') print(color_string) On Windows, call Windows.enable() before using colors; on Linux/macOS, call set_light_background() or set_dark_background() to toggle auto-colors. Verify before relying: - Whether the package still works reliably with Python 3.10+ despite being abandoned since 2021. - Whether Windows 10+ ANSI support mentioned in the description is fully functional without Windows.enable(). - Active community forks or maintained alternatives that may have addressed issues since abandonment. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 9.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags ansi color terminal output, colored console text, terminal color library, auto-detecting terminal colors, cross-platform console colors, colored text printing, terminal background detection, ansi-colors, cli-output, abandoned [View on SkillFed](https://skillfed.io/packages/colorclass) · [View on PyPI](https://pypi.org/project/colorclass/)