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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| colorty-0.1.6.tar.gz | 4.7 kB | Without provenance | Details for colorty-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| colorty-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for colorty-0.1.6-py3-none-any.whl |
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
|
Security for colorty 0.1.6
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.