Skip to main content

A modern Python library for elegant terminal output with rich formatting, colors, emoji support, and export capabilities

Project description

โœจ StyledConsole

Python >=3.10 License: Apache 2.0 Version Tests Coverage GitHub Sponsors Ko-fi

A modern Python library for elegant terminal output โ€” rich formatting, colors, emojis, gradients, and export capabilities built on top of Rich.

๐Ÿšง Early Access โ€” Currently available on TestPyPI. Some features may be experimental.

pip install -i https://test.pypi.org/simple/ styledconsole

๐ŸŽจ Visual Gallery

See the Visual Gallery for screenshots and animated demos.


๐Ÿš€ Why StyledConsole?

Rich is powerful, but StyledConsole adds the finishing touches:

Feature What It Does
๐ŸŒˆ Gradient Engine Smooth rainbows and linear gradients on borders, text, banners
๐ŸŽฏ Smart Icons 224 icons with automatic ASCII fallback for CI/legacy terminals
๐Ÿ“Š StyledTables Beautiful tables with gradient borders and config-driven creation
๐Ÿ”ง Environment Detection Auto-adapts for NO_COLOR, CI, TERM=dumb
๐Ÿ—๏ธ Frame Engine 8 border styles, nested frames, width alignment
๐Ÿ“ค HTML & Image Export Export to HTML, PNG, WebP, GIF with full emoji support
๐Ÿ“‹ Declarative Layouts Build entire UIs from JSON/dict config

โœจ Key Features

๐ŸŽฏ Smart Icon System

Policy-aware symbols with automatic ASCII fallback โ€” works everywhere:

from styledconsole import icons

print(f"{icons.ROCKET} Deploying...")      # ๐Ÿš€ in modern terminals
print(f"{icons.CHECK_MARK_BUTTON} Done!")  # โœ… or >>> in CI
Environment Output Rendering
Modern Terminal ๐Ÿš€ Full emoji
CI / Legacy >>> Colored ASCII

๐ŸŒˆ Gradient Frames & Borders

Smooth color transitions on any frame border:

from styledconsole import Console

console = Console()
console.frame(
    "Build successful!",
    title="Status",
    border="rounded",
    border_gradient_start="green",
    border_gradient_end="cyan",
)

๐Ÿ”ค ASCII Art Banners

500+ fonts with integrated gradient and rainbow support:

console.banner("HELLO", font="slant", rainbow=True)
console.banner("WORLD", font="big", start_color="cyan", end_color="magenta")

๐Ÿ“Š StyledTables

Beautiful tables with gradient borders, created from code or config:

from styledconsole.presets.tables import create_table_from_config

table = create_table_from_config(
    theme={"border_style": "heavy", "gradient": {"start": "cyan", "end": "blue"}},
    data={
        "columns": [{"header": "Service"}, {"header": "Status"}],
        "rows": [["API", "โœ… Online"], ["Database", "โœ… Online"]]
    }
)
console.print(table)

๐Ÿ”ง Environment-Aware Rendering

Automatically adapts for CI/CD pipelines and restricted terminals:

from styledconsole import Console, RenderPolicy

# CI-friendly: colors preserved, ASCII symbols
console = Console(policy=RenderPolicy.ci_friendly())

# Auto-detects: NO_COLOR, FORCE_COLOR, TERM=dumb, CI, GITHUB_ACTIONS

๐Ÿ“ค HTML & Image Export

Record terminal sessions and export to HTML or images:

console = Console(record=True)
# ... render your UI ...

# HTML export (built-in)
console.export_html("output.html")

# Image export (pip install styledconsole[image])
console.export_png("output.png")
console.export_webp("output.webp")
console.export_gif("animation.gif")  # animated!

๐Ÿ“‹ Declarative Layouts

Build complex dashboards from JSON/dict โ€” perfect for config-driven UIs:

from styledconsole.presets.layouts import create_layout_from_config

layout = create_layout_from_config({
    "type": "panel",
    "title": "DASHBOARD",
    "border": "heavy",
    "content": {"type": "text", "content": "Status: Online"}
})
console.print(layout)

๐Ÿ Quick Start

pip install -i https://test.pypi.org/simple/ styledconsole
from styledconsole import Console, icons

console = Console()

console.frame(
    f"{icons.CHECK_MARK_BUTTON} Build successful\n"
    f"{icons.ROCKET} Deployed to production",
    title=f"{icons.SPARKLES} Status",
    border="rounded",
    border_gradient_start="green",
    border_gradient_end="cyan",
)

Output:

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โœจ Status โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ โœ… Build successful        โ”‚
โ”‚ ๐Ÿš€ Deployed to production  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿ‘‰ Want more examples? Check out StyledConsole-Examples for 40+ real-world demos including CLI dashboards, progress bars, error reporters, and animated effects.


๐Ÿ—๏ธ Built On Giants

StyledConsole extends these excellent libraries:

Library Contribution
Rich ๐Ÿ’ช Core rendering engine
emoji ๐Ÿ˜€ 4000+ Unicode emojis
PyFiglet ๐Ÿ”ค 500+ ASCII art fonts
wcwidth ๐Ÿ“ Unicode width calculation
ansi2html ๐Ÿ’พ Terminal โ†’ HTML export

๐Ÿ“Š Project Status

v0.10.3 โ€” ๐Ÿ—๏ธ Early Access (TestPyPI)

Metric Value
๐Ÿงช Tests 1315 passing
๐Ÿ“Š Coverage 82%
๐Ÿ” MyPy 0 errors
๐Ÿ Python 3.10 โ€“ 3.14

๐Ÿ“š Documentation

Resource Description
๐Ÿ“– User Guide Complete API reference
๐Ÿ—๏ธ Developer Guide Architecture & internals
๐ŸŽจ Visual Gallery Screenshots & demos
๐Ÿ“… Changelog Version history
๐Ÿค Contributing Development workflow

๐Ÿ’™ Support

If StyledConsole improves your developer experience:

Platform Link
๐Ÿ’– GitHub Sponsors github.com/sponsors/ksokolowski
โ˜• Ko-fi ko-fi.com/styledconsole

๐Ÿ“„ License

Apache License 2.0 โ€” See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

styledconsole-0.10.3.tar.gz (894.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

styledconsole-0.10.3-py3-none-any.whl (240.2 kB view details)

Uploaded Python 3

File details

Details for the file styledconsole-0.10.3.tar.gz.

File metadata

  • Download URL: styledconsole-0.10.3.tar.gz
  • Upload date:
  • Size: 894.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for styledconsole-0.10.3.tar.gz
Algorithm Hash digest
SHA256 5240253d125ed39f4dc353cdb7d2694ac3dc5d82266944e2957c311422b3b33a
MD5 c6aae1bf1b5bd987c79b21e076f4ea2e
BLAKE2b-256 fda4a63449a7e01b0d8f9bbd07cce46ab893c9e7929236066d880945c43bcaee

See more details on using hashes here.

Provenance

The following attestation bundles were made for styledconsole-0.10.3.tar.gz:

Publisher: publish.yml on ksokolowski/StyledConsole

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file styledconsole-0.10.3-py3-none-any.whl.

File metadata

  • Download URL: styledconsole-0.10.3-py3-none-any.whl
  • Upload date:
  • Size: 240.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for styledconsole-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d09592026860d09e3208a1d9f1a08289fe98c892cd0c04d412044c477b8d90d0
MD5 5aef85cb8e57e0e78015ed4b1e0e4063
BLAKE2b-256 c30b3b825ed3410261b3f23643e685777cc9916f14820c6ff86ee112c57a4705

See more details on using hashes here.

Provenance

The following attestation bundles were made for styledconsole-0.10.3-py3-none-any.whl:

Publisher: publish.yml on ksokolowski/StyledConsole

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page