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
File details
Details for the file pansi-2024.11.0.tar.gz
.
File metadata
- Download URL: pansi-2024.11.0.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 018186294f012ae48e207d9446b1bd22b0f2ebb2de60a6c4fb079abfacdf4a37 |
|
MD5 | b3d23cf310807b9e84a9b02dfa82b8f3 |
|
BLAKE2b-256 | b2932583b4b709707cc3b3dffc6ae49d6e96031eae46bd71c047b48417bac66d |
File details
Details for the file pansi-2024.11.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pansi-2024.11.0-py2.py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79275348a03e022d4482d0bbd9fe7fae7741eb2de84dbe560631d48a9fa522e5 |
|
MD5 | 35e7905644c1848d1b7122f8bb2e5050 |
|
BLAKE2b-256 | 0b818d19773a1da754e6c9342ca7801d0d75775425ea729e127e4851de63d8da |