--- id: sty version: "1.0.6" license: Apache-2.0 license_treatment: permissive maintenance: dormant --- # sty — String styling for your terminal License: permissive · Maintenance: dormant · Downloads: 244.0K/mo ## What it is and what it does Sty is a zero-dependency library for styling terminal output with colors and text effects. It decouples styling markup from color palettes and terminal implementations, letting you write color codes once and swap renderers or palettes without changing your code. It supports 3/4bit, 8bit, and 24bit (RGB) colors, effects like bold and italic, and allows you to mute all styles globally. The library is fully typed, does not modify globals like some alternatives do, and provides high-performance access to styling rules. You apply styles by concatenating string constants (fg.red, bg.blue, ef.bold) with your text, then reset with reset codes (fg.rs, bg.rs, rs.italic). You can also create custom color registers by subclassing the built-in register classes, or use the Register class directly to define your own styling rules. Use it for: - Add colored and bold output to CLI tools and scripts for better readability and user feedback. - Create custom color palettes for logging or status messages without rewriting markup in your code. - Build terminal applications that need RGB colors or effects across Unix, macOS, and modern Windows terminals. - Mute all terminal styling globally for log files or non-interactive environments without code changes. - Extend default color and effect registers with domain-specific styles (e.g., error red, success green). ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Sty provides a simple, customizable string styling markup for terminal output, supporting 3/4bit, 8bit, and 24bit colors plus effects like bold, italic, and underline, with no external dependencies. Yes, if you need simple, zero-dependency terminal styling. Sty is lightweight, well-typed, and avoids global modifications that cause compatibility issues. The dormant maintenance status is not a blocker for stable use—the library is feature-complete and has no known vulnerabilities—but monitor the repository if you rely on it for new Python versions beyond 3.12. ## Install pip install sty uv add sty poetry add sty ## Installing sty Before you install: Low friction: pure Python wheel with zero runtime dependencies. Maintenance is dormant (last release November 2023, 991 days ago), but the repository remains active and unarchived with no recent breaking changes signaled. License in practice: Apache-2.0 is permissive; you can use, modify, and distribute sty freely in commercial and open-source projects with minimal restrictions. Quickstart: from sty import fg, bg, ef, rs print(fg.red + 'Red text' + fg.rs) print(bg.blue + 'Blue background' + bg.rs) print(ef.bold + 'Bold text' + rs.bold) Requires Python >=3.7,<4.0; legacy Windows terminal (cmd) may need a workaround for ANSI support. Verify before relying: - Whether dormant maintenance (991 days since last release) poses a risk for future Python or terminal compatibility issues. - Actual compatibility status with modern Windows terminals beyond the documented legacy cmd limitation. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 244.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags terminal color styling, ansi string formatting, cli text colors, terminal text effects, colored output library, rgb terminal colors, command line styling, terminal-styling, ansi-colors, cli-tools [View on SkillFed](https://skillfed.io/packages/sty) · [View on PyPI](https://pypi.org/project/sty/)