mantis-colors
A simple, lightweight, and modern Python library for adding color and style to your terminal output.
Installation
pip install mantis-colors
Quick Start
from mantis_colors import fg, bg, style, init
# You can initialize with autoreset so you don't have to manually reset colors after every color change!
init(autoreset_enabled=True)
print(fg.red + "red color")
print(bg.blue + fg.white + "white text on blue background")
print(fg.hex("#ff6600") + style.bold + "bold orange text using HEX")
Features
Colors (Standard & True Color)
Mantis Colors supports standard ANSI colors, as well as RGB and HEX for 24-bit True Color support.
from mantis_colors import fg, bg
# Standard colors
print(fg.green + "success!")
print(fg.red + "error!")
# RGB Support
print(fg.rgb(255, 100, 0) + "RGB orange")
print(bg.rgb(0, 100, 255) + "RGB blue background")
# HEX Support (with or without #)
print(fg.hex("#ff6600") + "HEX orange")
print(bg.hex("0066ff") + "HEX blue background")
Text Styles
Apply common text decorations with ease.
from mantis_colors import style
print(style.bold + "Bold Text")
print(style.underline + "Underlined Text")
print(style.strikethrough + "Strikethrough")
print(style.bold + style.italic + "Bold and Italic")
Automatic Reset
Are you tired of manually adding reset every time? Use init() or autoreset() to handle it globally.
from mantis_colors import init, fg, autoreset
autoreset()
print(fg.red + "Everything is reset after each print call automatically")
# or
init(autoreset_enabled=True)
print(fg.red + "Everything is reset after each print call automatically")
Comparison
| Feature | mantis-colors |
colorama |
termcolor |
|---|---|---|---|
| RGB Support | ✅ | ❌ | ❌ |
| HEX Support | ✅ | ❌ | ❌ |
| Simple API | ✅ | ✅ | ✅ |
| Auto-reset | ✅ | ✅ | ❌ |
License
MIT © Adyanth M
Metadata
Release files for mantis-colors 0.1.1
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 |
|---|---|---|---|---|
| mantis_colors-0.1.1.tar.gz | 5.8 kB | Without provenance | Details for mantis_colors-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mantis_colors-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for mantis_colors-0.1.1-py3-none-any.whl |
Total release size: 12.1 kB
Release files / mantis_colors-0.1.1.tar.gz
| Download URL | mantis_colors-0.1.1.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8067c70d79f10f635405d3cac6fd6841e9a40f907f8a8c23f1cdfb75cdbd7b79
|
|
BLAKE2b-256 checksum How to use checksums |
b750c64309c80bc5b33e345826736b591b67a40b5585eaf506523fb523ba4e95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / mantis_colors-0.1.1-py3-none-any.whl
| Download URL | mantis_colors-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
354b919e06499c53624683bf1b32fdd4daa499a5773276a67fb073f7d42abcc4
|
|
BLAKE2b-256 checksum How to use checksums |
7fbf60da25bac4aa609563e71e9b45b2b2d7e3d8bda8d58605b2e22bbbdb7176
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for mantis-colors 0.1.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.