Skip to main content

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 styling
  • pansi.image -- terminal-based image rendering
  • pansi.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!

Metadata

Release files for pansi 2024.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pansi 2024.11.0
File Size Uploaded Provenance Actions
pansi-2024.11.0.tar.gz 24.8 kB Without provenance Details for pansi-2024.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pansi 2024.11.0
File Interpreter ABI Platform Actions
pansi-2024.11.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for pansi-2024.11.0-py2.py3-none-any.whl

Total release size: 51.1 kB

Release files / pansi-2024.11.0.tar.gz

Download URL pansi-2024.11.0.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
018186294f012ae48e207d9446b1bd22b0f2ebb2de60a6c4fb079abfacdf4a37
BLAKE2b-256 checksum
How to use checksums
b2932583b4b709707cc3b3dffc6ae49d6e96031eae46bd71c047b48417bac66d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / pansi-2024.11.0-py2.py3-none-any.whl

Download URL pansi-2024.11.0-py2.py3-none-any.whl
Size 26.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
79275348a03e022d4482d0bbd9fe7fae7741eb2de84dbe560631d48a9fa522e5
BLAKE2b-256 checksum
How to use checksums
0b818d19773a1da754e6c9342ca7801d0d75775425ea729e127e4851de63d8da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Security for pansi 2024.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page