Rich Toolkit
This is a very opinionated set of components for building CLI applications. It is based on Rich
Installation
pip install rich-toolkit
Example usage
Rich toolkit comes with an App class, this is used to give a consistent
style to your CLI application, it can be used as a context manager, like so:
TODO: new example
Output encoding
The consoles created by Rich Toolkit respect the output stream's encoding.
Characters that the stream can encode are printed unchanged. Unsupported
characters in human-readable content are replaced with ?:
for example, café 🚀 becomes café ? on a CP1252 stream.
Stored input and menu values are never changed by this display conversion.
Built-in menu markers and style decorations use ASCII alternatives when needed.
Custom styles can use self.symbol("●", fallback=">") for decorations and
self.display_text(value) when measuring or positioning arbitrary text.
Rich Text is converted before wrapping, with table cells and common layout
wrappers also prepared before measurement. Styles and links are preserved.
Unsupported characters in hyperlink targets
are percent-encoded as UTF-8, preserving the destination. Custom
renderables emitting raw Segment objects also get a final encoding fallback;
they should prepare text before computing their own layout to account for the
changed character widths.
JSON output always uses ASCII with JSON escapes for Unicode characters, including on UTF-8 streams. Decoding the JSON restores the original values.
The library does not reconfigure sys.stdout or sys.stderr. Human-readable
encoding fallbacks apply to the toolkit's default consoles; a custom replacement
console is responsible for its own encoding policy.
Running tests with an encoding
Run the entire suite with a selected output encoding:
PYTHONIOENCODING=cp1252:strict uv run pytest
The suite supports utf-8 (the default), ascii, cp1252, and gbk. Its
capture streams and in-memory output streams use the selected encoding with
strict errors, including when tests call capsys.readouterr(). Individual
encoding regression tests still use their explicitly selected streams.
GitHub Actions runs the full suite in UTF-8 across the Python/Pydantic matrix, plus ASCII, CP1252, and GBK runs on Python 3.14 with Pydantic v2.
Metadata
Release files for rich-toolkit 0.20.6
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 |
|---|---|---|---|---|
| rich_toolkit-0.20.6.tar.gz | 213.5 kB | Without provenance | Details for rich_toolkit-0.20.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rich_toolkit-0.20.6-py3-none-any.whl | Python 3 | none | any | Details for rich_toolkit-0.20.6-py3-none-any.whl |
Total release size: 253.0 kB
Release files / rich_toolkit-0.20.6.tar.gz
| Download URL | rich_toolkit-0.20.6.tar.gz |
|---|---|
| Size | 213.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04768f19438df877c6279e6e668ab0d88b5fff5c7ef3ac302838d97f7b03472e
|
|
BLAKE2b-256 checksum How to use checksums |
61fee851890b72568a075a3574f760eed9014736b449fe104b16fd05a416c321
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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 / rich_toolkit-0.20.6-py3-none-any.whl
| Download URL | rich_toolkit-0.20.6-py3-none-any.whl |
|---|---|
| Size | 39.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
465453ba6f94f99401f59f79fb562827ba5f6b4d4759015d40019f5c67750262
|
|
BLAKE2b-256 checksum How to use checksums |
79fc7c296a563a893b0a23a73923ce27965ae15f658dcb58c0bcdd463e1671a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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}
|
Security for rich-toolkit 0.20.6
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.