Skip to main content

colorise provides easy cross-platform text coloring for terminals/consoles and has been tested on different platforms/terminals.

Installation

Install colorise via pip.

pip install colorise

To get started check out the docs, tutorial or the examples.

Features

  • Supports 8, 16, 88, 256 colors and true-color.
  • Colors can be specified by name, index, hexadecimal, HLS, HSV or RGB formats.
>>> colorise.cprint('Hello', fg='red')
>>> colorise.cprint('Hello', bg=201)
>>> colorise.cprint('Hello', fg='#a696ff')
>>> colorise.cprint('Hello', bg='0xa696ff')
>>> colorise.cprint('Hello', fg='hls(0.6923;0.7960;1.0)')
>>> colorise.cprint('Hello', fg='hsv(249;41;100)')
>>> colorise.cprint('Hello', bg='rgb(167;151;255)')
>>> colorise.fprint('{fg=red}Hello {bg=blue}world!')
  • Automatically find the closest color based on the terminal's capabilities. Below is sprite of a familiar plumber. Pixels are specified as RGB so colorise automatically approximates colors for 256 and 16 color indices in the two right-most images.
From left to right: True-color, 256 color and 16 color.

  • Useful functions like highlight that highlights individual characters in a string given a list of indices.
  • Support for attributes such as bold, italic, underline etc.
>>> colorise.highlight('Hello world', indices=[0, 2, 3, 7, 9], attributes=[Attr.Italic])

Metadata

Release files for colorise 1.0.1

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

Source distribution (sdist)

Source distribution for colorise 1.0.1
File Size Uploaded Provenance Actions
colorise-1.0.1.tar.gz 190.4 kB Without provenance Details for colorise-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for colorise 1.0.1
File Interpreter ABI Platform Actions
colorise-1.0.1-py3-none-any.whl Python 3 none any Details for colorise-1.0.1-py3-none-any.whl

Total release size: 211.6 kB

Release files / colorise-1.0.1.tar.gz

Download URL colorise-1.0.1.tar.gz
Size 190.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3ca58729c426f616c662042a7e73030df8c2c147851faf20178afe89e5a05598
BLAKE2b-256 checksum
How to use checksums
c68635a9657e082725380b4a425dfdd96e1de735f9d8d59cc35b4f8b8594545a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.4

Release files / colorise-1.0.1-py3-none-any.whl

Download URL colorise-1.0.1-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3f39a0c8d28594687e52d861ea51c241022b68d7f317acced8e9181fd820681
BLAKE2b-256 checksum
How to use checksums
b8c6f27fa479cafc6e6e34b6affb2305e852ddd09570c2bca9da3c5f7feec184
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.4

Security for colorise 1.0.1

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