Skip to main content
RazTint Logo

RazTint

Semantic formatting for Python CLIs with built-in secret redaction.


Python Versions PyPI Version Zero Dependencies Codecov

Keep your CLI output consistent. Write what a message means, not how it should look. RazTint handles colors, icons, and common secret redaction for you.


Preview

RazTint preview: Nerd Font, Unicode, and ASCII icon modes with colored and styled output examples

A simulated production log stream: 9 secrets detected, 9 secrets redacted, 0 leaked to the terminal.


Installation

Requires Python 3.10+.

pip install raztint
# with uv
uv add raztint

From source:

git clone https://github.com/razbuild/raztint.git
cd raztint
uv sync

Quick Start

from raztint import paint, ok

# icon shortcut
print(f"{ok()} Build passed.")

print(paint("Connection failed.", intent="error"))

# secrets are redacted before the string is printed
print(paint("password=1234", intent="debug", redact=True))
# password=****

paint() returns a plain string. Pass it to print(), a logging handler, or anywhere else a string works.

See Getting Started for installation and common usage.


Why RazTint

  • Semantic output instead of ANSI escape codes
  • Automatic secret redaction before rendering
  • Works anywhere a string is accepted

The problem

CLI output drifts over time. One module prints green for success, another adds an emoji, a third does both differently. Six months in, nothing agrees.

Debug logging is often where secrets slip through. A stray print(f"token={token}") is easy to add while troubleshooting and easy to forget. It ends up in your terminal or your logs.

# before: every call site invents its own formatting, and secrets slip through
print(f"\033[31mAuth failed for token={token}\033[0m")

# after: one call, styled and redacted
print(paint(f"Auth failed for token={token}", intent="error", redact=True))
# Auth failed for token=****

Core features

  • Semantic intents success, error, warning, debug, and more. Use semantic names instead of choosing colors manually.

  • State-aware output case() maps application states to semantic intents, while transient() provides temporary terminal output for in-progress operations.

  • Redaction masks key=value pairs such as password=, api_key=, and token=. Patterns are configurable, see Security and Redaction.

  • Icon helpers ok(), err(), warn(), info(), pending(), debug(). Falls back from Nerd Font to Unicode to ASCII depending on the terminal.

  • Manual control raw 16/256/True Color and text styles, for the cases intents don't cover.

  • Type hints throughout ships with py.typed. Respects NO_COLOR and RAZTINT_FORCE_COLOR.


Design philosophy

[!NOTE] Make terminal output consistent, meaningful, and safe by default.

RazTint is not a terminal UI framework. It doesn't hook into logging or replace a handler. It stays a formatting layer, on purpose:

  • ANSI color support
  • Semantic logging helpers
  • Automatic icon fallback
  • Secret redaction
  • Zero external dependencies

A small scope keeps RazTint focused.


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 and Redaction Masking tokens, credentials, and custom rules
Icons and Detection Icon modes and environment/font/color detection logic
Configuration Environment variables and runtime toggles
Development Local setup, tests, and linting

Examples: showcase.py · file_processor.py · redaction_demo.py


Known limitations

  • Python 3.10+ only.
  • Font detection relies on OS tools (fc-list, system_profiler, PowerShell). Set RAZTINT_SKIP_SYSTEM_FONT_SCAN=1 in sandboxed environments.
  • Setting NO_COLOR suppresses all color output, regardless of other settings.

Contributing

PRs and issues are welcome. Open an issue first to discuss any new feature.

See Contributing Guide for setup and guidelines.


License

License

Made by RazBuild

Metadata

Release files for raztint 0.10.0

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

Source distribution (sdist)

Source distribution for raztint 0.10.0
File Size Uploaded
raztint-0.10.0.tar.gz 15.1 kB Details

Built distribution (wheel)

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

Total release size: 37.7 kB

Release files / raztint-0.10.0.tar.gz

Download URL raztint-0.10.0.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fc4208f7346a3bd1578e3c8fe9e9f0ab00d1c64c70789a4b9e42a997261cf18c
BLAKE2b-256 checksum
How to use checksums
3a5c3e5e17b173c7725ffd8e4ff728194a3ee8627f2b9b0adad720a54da42495
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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}

Release files / raztint-0.10.0-py3-none-any.whl

Download URL raztint-0.10.0-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cc938d987a06434ff18636697e4e8f9fb1a545a718be0fc710b32ac1cd37ff0
BLAKE2b-256 checksum
How to use checksums
c7c1607de0d858b9dd4ebefaaa3d7519726a6f74420505326655b7316edeb425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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}

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

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