Skip to main content

A zero-dependency Python library for ANSI coloring and smart CLI icons with automatic environment detection

Project description

RazTint

PyPI Version PyPI Downloads Python Versions License Zero Dependencies

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
ASCII Nerd Font Unicode

Why RazTint?

  • Zero dependencies — Python ≥ 3.10 standard library only
  • Smart icons — Nerd Font → Unicode → ASCII fallback, with environment-aware detection
  • 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!"))
print(f"{ok()} File saved.")
print(paint("Connection failed.", color="red", icon="err"))

# 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. Icon output depends on the detected mode: Nerd Font, standard Unicode, or ASCII.


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 environment/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

Made by RazBuild

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

raztint-0.7.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

raztint-0.7.1-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

Details for the file raztint-0.7.1.tar.gz.

File metadata

  • Download URL: raztint-0.7.1.tar.gz
  • Upload date:
  • Size: 12.7 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

Hashes for raztint-0.7.1.tar.gz
Algorithm Hash digest
SHA256 180ec87172485b63ae3a646dfec8182c3d14a29c166f091bf568ed233131dd53
MD5 b55cba575f2b331cd7ddef1952a92be8
BLAKE2b-256 da1bfbf12c9f5d6a92e0055b83cc9320f14edde3897c71b4b1657246f59f494d

See more details on using hashes here.

File details

Details for the file raztint-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: raztint-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 19.9 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

Hashes for raztint-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a602c43141d3b1c3719bcef72f94670f13ab910bef8e5e96dcce73be271b96c5
MD5 742c074da37c1ae3bf055cc82072022d
BLAKE2b-256 20a4a45acf3f9049aa50b4f6b6b8dcca327ad45c8eac639220265ea1d905377d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page