Skip to main content

Colorty

Colorty is a Python library for handling colored text in various terminal environments including Windows CMD, PowerShell, and Unix-like terminals on Ubuntu and macOS.

Installation

Install Colorty using pip:

pip install colorty

Usage

Basic example:

from colorty import set_color, reset_color
set_color('RED') # Set text color to red using color name
print("This text is red")
set_color('31') # Set text color to red using ANSI code
print("This text is still red")
set_color('GREEN') # Set text color to green using color name
print("This text is green")
set_color(32) # Set text color to green using ANSI code
print("This text is still green")
reset_color() # Reset text color to default
print("This text is default color")

Using the Clt class:

from colorty import Clt

# format partial string with color
print(f"This is {Clt.RED}partial red{Clt.RESET} and {Clt.BLUE}partial blue{Clt.RESET} text.")

API Reference

  • set_color(color): Sets the terminal text color.
  • reset_color(): Resets the terminal text color to default.
  • Clt: Class with predefined ANSI color codes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgments: inspired from the Colorama library.

Metadata

Release files for colorty 0.1.6

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

Source distribution (sdist)

Source distribution for colorty 0.1.6
File Size Uploaded
colorty-0.1.6.tar.gz 4.7 kB Details

Built distribution (wheel)

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

Total release size: 10.9 kB

Release files / colorty-0.1.6.tar.gz

Download URL colorty-0.1.6.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4aef3676ea8eb58a171f06b672f16364876187957bb0c52ba9c9bf647c9d7fdb
BLAKE2b-256 checksum
How to use checksums
0fa0f4b9f10018745ade9c04e32d5ef4e0f7939c191da4a922fc6855a5ae2e18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.0

Release files / colorty-0.1.6-py3-none-any.whl

Download URL colorty-0.1.6-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ed83a5b3555e48d674c891edcf00a5a26739b1d982798d9d0c4480898354c93
BLAKE2b-256 checksum
How to use checksums
2f6b263514f5794c2c02317771c98f215d3a912a662bf72bbb1f6d7e080038b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.0

2 release files

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