A zero-dependency Python library for ANSI coloring and smart CLI icons with automatic environment detection
Project description
A zero-dependency Python library for ANSI coloring and smart CLI icons that automatically adapt to your environment.
Preview
| ASCII Icons | Nerd Font Icons | Unicode Icons |
|---|---|---|
Why RazTint?
- Zero dependencies — Python ≥ 3.10 standard library only
- Smart icons — Nerd Font → Unicode → ASCII fallback, detected automatically
- Cross-platform behavior — Linux, macOS, and Windows, including CI
- Minimal setup — import and use; detection is cached and fast
Features
- 🎨 Full ANSI 16-color foreground and background support
- ✨ Text styles: bold, dim, italic, underline, strikethrough
- 🔍 Status icons with three-tier fallback and environment-aware detection
- 🖌️
paint()— one call for color, background, styles, and icons - 🎯 Intents — semantic presets (
success,danger,warning, …) - 🔒 Redaction — mask secrets in logs before printing
- 💡 Fully type-hinted public API (
py.typed, IDE autocompletion) - ⚙️ Configurable via environment variables (
NO_COLOR,RAZTINT_FORCE_COLOR, …)
Requirements
- Python 3.10 or newer
Installation
pip install raztint
From source:
git clone https://github.com/razbuild/raztint.git
cd raztint
uv sync
Quick Start
from raztint import green, ok, paint
print(green("Success!")) # green text
print(f"{ok()} File saved.") # ✓ File saved.
print(paint("Connection failed.", color="red", icon="err")) # ✗ Connection failed.
# Semantic intents
print(paint("Deployment complete.", intent="success"))
# Mask secrets before logging
print(paint("password=1234", intent="debug", redact=True)) # password=****
Standalone redaction without formatting:
from raztint import redact
print(redact("password=supersecret api_key=ghp_abc123"))
# password=**** api_key=****
See Getting Started for more examples.
Documentation
| Guide | Description |
|---|---|
| Getting Started | Functional usage, paint(), and the tint instance |
| API Reference | Colors, styles, icons, and RazTint class methods |
| Intents | Semantic presets for common CLI messages |
| Security & Redaction | Masking tokens, credentials, and custom rules |
| Icons & Detection | Icon modes and font/color detection logic |
| Configuration | Environment variables and runtime toggles |
| Development | Local setup, tests, and linting |
Contributing
PRs and issues are welcome. If you find a bug or want to add a feature, open an issue first so we can discuss it. See CONTRIBUTING.md for setup and guidelines.
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file raztint-0.7.0.tar.gz.
File metadata
- Download URL: raztint-0.7.0.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e12f001f697e428d776b3c7bfb453257d76ed2c5ea8a850cb75b544b05d21939
|
|
| MD5 |
b007b30f52a4f964cf51353e3891b122
|
|
| BLAKE2b-256 |
09bd901afe0ec810cc90a7409887c50707fb368bf0676b992df7c501161b3f61
|
File details
Details for the file raztint-0.7.0-py3-none-any.whl.
File metadata
- Download URL: raztint-0.7.0-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3458ac09908e432d428e690eb45a8e6f71ed8eaa508ae1ca901e36005a8403f0
|
|
| MD5 |
dfbcd2c7a3b9877bda218b0d7782f98d
|
|
| BLAKE2b-256 |
0382a0d984beb54884ee5a2e83df8e917e4b8a38a6092136231a7118295993ac
|