sty – string styling for your terminal

Sty’s goal is to provide Python with a simple, customizable and performant string styling markup, which is decoupled from color palettes and terminal implementations.

Sty requires Python >= 3.7.

This is free and open source software.

  • Supports 3/4bit, 8bit and 24bit (truecolor/RGB) colors as well as effects like bold, italic, underline, etc.
  • Works with most Linux terminals. It works with recent Windows terminals. Window legacy terminal (cmd) needs a shim to work.
  • Comes with default color palettes and renderers, but you can easily replace/customize them, without touching the markup in your code.
  • Mute/unmute all styles in your codebase.
  • Provides high access performance for all styling rules.
  • Fully typed, you should get good editor support for it.
  • Does not implicitly mess with globals. E.g.: colorama overrides sys.stdout which causes a lot of trouble.
  • No dependencies.
  • Follows semver.

Website: github.com/feluxe/sty
Support:
Developer: Felix Meyer-Wolters
License: Apache License 2.0

sty example
Click image for full size

sty is written in Python. Learn Python with our recommended free books and free tutorials.


Related Software

Terminal String Styling Tools
RichPython library for rich text and beautiful formatting
ChalkBills itself as “Terminal string styling done right”
picocolorsTiny and fast library for terminal output formatting
yoctocolorsSmall and fast command-line coloring package
yachalkClone of Chalk written in Python
kleurNode.js library for formatting terminal text with ANSI colors
coloretteSet your terminal text color and styles
styString styling for your terminal
termcolorANSI color formatting for output in the terminal
coloredSimple Python library for color and formatting in terminal
ansicolorsANSI colors for Python
ansi-colorsAdd ANSI colors to terminal text

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments