Skip to main content

sondalab-palette

Sondalab terminal palette: semantic color roles with a named-ANSI floor and a truecolor opt-in.

Color is applied to roles, never to decoration — a hue mismatch is never a legibility failure. On any terminal you get the named-ANSI floor (resolves through the user's theme); when COLORTERM=truecolor, roles upgrade to the exact brand hues. NO_COLOR disables color.

from sondalab_palette import paint, supports_truecolor

print(paint("done", "ok"))          # green floor / #62D094 on truecolor
print(paint("careful", "warn"))     # yellow floor / amber on truecolor
print(paint("failed", "err"))       # red floor / soft-red on truecolor

Roles: prompt, ok, warn, err, dim, accent.

Term tokens and the reference helper (0.6.0)

The Term spec's numbers are constants, so a CLI never re-derives them: GLYPHS, LAYOUT, RAMP, SPINNER, DECODE, PROGRESS, MOTION, BOX, KEYS, ROBUSTNESS and ENV.

sondalab_palette.term builds the spec's strings and reads its environment rules. It writes nothing and keeps no time: redraw and timing are the caller's (SPINNER["intervalMs"], DECODE["frameMs"], MOTION["maxFps"]).

import random, sys
from sondalab_palette import term

motion = term.motion_enabled()                 # off for non-TTY, CI, TERM=dumb, reduced motion, accessible
ascii = term.ascii_mode(override=args.ascii or None)
term.color_mode(flag=args.color, truecolor=True)   # 'none' | 'ansi16' | 'truecolor'

term.step_line("done", "Resolved 128 probes", "2.1s", ascii=ascii)
# '  ✓ Resolved 128 probes         2.1s'
term.progress_bar(61, 128, ascii=ascii)
# '    ███████████▓▒░             61/128   48%'
term.spinner_frame(i, ascii=ascii)             # the glyph-column frame at tick i
term.decode_frames("sha 9c41e0b", random.Random(), ascii=ascii)  # 4 frames, last is the value

The helper returns uncoloured text; paint the glyph with its GLYPHS role.

The environment rules are public, so a consumer never re-derives them (0.7.0):

term.accessible()                # SONDALAB_ACCESSIBLE=1, or ACCESSIBLE set (even empty)
term.reduced_motion()            # SONDALAB_REDUCED_MOTION=1, or accessible()
term.switch_on("ci")             # any switch purpose in ENV: reducedMotion, accessible, ci, ascii

switch_on reads SONDALAB_* as on only when it equals 1, and CI/ACCESSIBLE as on whenever set; a purpose that is not a switch raises KeyError. motion_enabled and ascii_mode are built on these.

paint() predates the Term spec and does not consult color_mode: it ignores the flag, FORCE_COLOR and TTY detection, and upgrades to truecolor whenever COLORTERM allows it. A caller that follows the spec's colour precedence builds the SGR itself from ROLES, based on the mode.

Changelog

  • 0.7.0: public term.accessible(), term.reduced_motion() and term.switch_on(name), the spec's environment switch rule; motion_enabled and ascii_mode now use them.
  • 0.6.0: Term tokens (RAMP, SPINNER, DECODE, PROGRESS, MOTION, BOX, KEYS, ROBUSTNESS, ENV) and the term reference helper.

Generated from the canonical sondalab.tokens.json — do not hand-edit sondalab_palette/__init__.py.

Metadata

Release files for sondalab-palette 0.7.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 sondalab-palette 0.7.0
File Size Uploaded Provenance Actions
sondalab_palette-0.7.0.tar.gz 7.7 kB With provenance Details for sondalab_palette-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sondalab-palette 0.7.0
File Interpreter ABI Platform Actions
sondalab_palette-0.7.0-py3-none-any.whl Python 3 none any Details for sondalab_palette-0.7.0-py3-none-any.whl

Total release size: 16.1 kB

Release files / sondalab_palette-0.7.0.tar.gz

Download URL sondalab_palette-0.7.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
35f7e282c8ddb7d40c155e308dbecad8e2d4078cfb23c04aef5653eba281bcfc
BLAKE2b-256 checksum
How to use checksums
3c8dcf733cda140d6dde9db12b8a2e6f88c1aede417064c0596267a411fb96aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / sondalab_palette-0.7.0-py3-none-any.whl

Download URL sondalab_palette-0.7.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0163eeae9ab54cb6cd39acd44c15b137a765765db8753768d7d88a47f8ea38e4
BLAKE2b-256 checksum
How to use checksums
ef52319108f3c11b3c3a719afa6a0b1adb558c237f0d6dd11414b7d571e628ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for sondalab-palette 0.7.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sondalab_palette-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

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.

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