Text mode rendering library
Project description
Pansi
Pansi is a text mode rendering library. It provides a clean and simple interface for working with text and graphics in the terminal, using ANSI escape sequences for rendering. The library provides the following modules:
pansi.text
-- text colouring and stylingpansi.image
-- terminal-based image renderingpansi.screen
-- full screen layout handling
Most modern terminals support ANSI rendering, but the exact feature sets available do vary. Bear in mind that not every listed function might work in every terminal, and check the documentation for your terminal software to make sure.
pansi.text
The pansi.text
module provides a suite of functions for colouring and styling
terminal text, using ANSI escape sequences. Functions are designed to align as
closely as possible to CSS rules and properties, for ease of use.
Colours
Let's start with something simple. The following example will render the word "world" in green:
>>> from pansi.text import green
>>> print(f"Hello, {green}world{~green}!")
Hello, world!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pansi-2024.11.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79275348a03e022d4482d0bbd9fe7fae7741eb2de84dbe560631d48a9fa522e5 |
|
MD5 | 35e7905644c1848d1b7122f8bb2e5050 |
|
BLAKE2b-256 | 0b818d19773a1da754e6c9342ca7801d0d75775425ea729e127e4851de63d8da |