skillfed

sty

String styling for your terminal

sty v1.0.6 244.0K downloads/30d#8,767 on PyPI218
Permissive license Apache-2.0 DORMANT released

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 on this page — 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

sty on PyPI

pip

pip install sty

uv

uv add sty

poetry

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 the current Python release (>=3.7,<4.0)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 991 days since the last release
Last repo commit
First released
Downloads 243,995/month — #8,767 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sty-1.0.6-py3-none-any.whl

Keywords: styling, color, colour, terminal, ansi, command, line, cli

License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: PrintingTopic :: System :: ShellsTopic :: TerminalsTyping :: Typed

Tags

terminal color stylingansi string formattingcli text colorsterminal text effectscolored output libraryrgb terminal colorscommand line styling
terminal-stylingansi-colorscli-tools

More Terminals packages