Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pansi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pansi

Text mode rendering library

  • 2024.11.0
  • PyPI
  • Socket score

Maintainers
1

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!

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc