Socket
Socket
Sign inDemoInstall

pastel

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pastel

Bring colors to your terminal.


Maintainers
1

Readme

Pastel: Bring colors to your terminal #####################################

Pastel is a simple library to help you colorize strings in your terminal.

It comes bundled with predefined styles:

  • info: green
  • comment: yellow
  • question: black on cyan
  • error: white on red

.. image:: https://raw.githubusercontent.com/sdispater/pastel/master/assets/screenshot.png

Features

  • Use predefined styles or add you own.
  • Disable colors all together by calling with_colors(False).
  • Automatically disables colors if the output is not a TTY.
  • Used in cleo <https://github.com/sdispater/cleo>_.
  • Supports Python 2.7+, 3.5+ and PyPy.

Usage

.. code-block:: python

>>> import pastel
>>> print(pastel.colorize('<info>Information</info>'))
'Information'  # Green string by default
>>> print(pastel.colorize('<fg=red;options=bold>This is bold red</>'))
'This is bold red'

Installation

.. code-block::

pip install pastel

FAQs


Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc