https://github.com/sdispater/pastel
Bring colors to your terminal
https://github.com/sdispater/pastel
cli python
Last synced: about 1 year ago
JSON representation
Bring colors to your terminal
- Host: GitHub
- URL: https://github.com/sdispater/pastel
- Owner: sdispater
- License: mit
- Created: 2017-02-01T23:27:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-09-16T19:21:31.000Z (almost 6 years ago)
- Last Synced: 2025-04-12T01:41:37.684Z (about 1 year ago)
- Topics: cli, python
- Language: Python
- Size: 140 KB
- Stars: 51
- Watchers: 5
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
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 `_.
* Supports Python **2.7+**, **3.5+** and **PyPy**.
Usage
=====
.. code-block:: python
>>> import pastel
>>> print(pastel.colorize('Information'))
'Information' # Green string by default
>>> print(pastel.colorize('This is bold red>'))
'This is bold red'
Installation
============
.. code-block::
pip install pastel