Registry / serialization / rich-rst

rich-rst

JSON →
library2.1.0pypypi✓ verified 27d ago

A Python library that provides a beautiful reStructuredText renderer, integrating with the `rich` library to display reStructuredText documents with syntax highlighting and rich formatting directly in the terminal. It's currently at version 1.3.2 and maintains an active release cadence with regular updates and bug fixes.

pip install rich-rst
INSTALL
IMPORT
SIG · RICH-RST
R
rich-rst
serializationpythonv2.1.0
Install
2.7s avg
Import
384ms
Disk
31MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.406s · 32.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.7s · import 0.362s · 33MB
31MB installed
● package 31MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RestructuredText
from rich_rst import RestructuredText
print
from rich import print
Used for displaying rich content to the console.

This quickstart demonstrates how to import `RestructuredText` from `rich_rst` and use it with `rich.print` to render a reStructuredText string directly to your terminal with rich formatting.

from rich_rst import RestructuredText from rich import print rst_content = """ My Document =========== This is a *simple* reStructuredText document. .. code:: python print('Hello, Rich RST!') - Item 1 - Item 2 .. note:: This is a note. """ # Render the reStructuredText to the console print(RestructuredText(rst_content))
Debug
Known issues
gotchaCompatibility with `docutils` versions can be sensitive. `rich-rst` is regularly updated to track `docutils` changes (e.g., v1.3.2 updated for Docutils 0.22). Ensure your `docutils` version is compatible to avoid rendering issues.
fix
Upgrade `rich-rst` to the latest version (`pip install --upgrade rich-rst`) to ensure compatibility with recent `docutils` versions.
affects: <1.3.2
gotchaOlder versions of `rich-rst` (pre-1.3.0) might have exposed `docutils`' internal `optparse` deprecation warnings. While fixed in newer releases, this indicates potential for upstream dependency deprecations impacting users.
fix
Upgrade to `rich-rst` version 1.3.0 or newer to mitigate `optparse` deprecation warnings from `docutils`.
affects: <1.3.0
gotchaWhile `rich-rst` supports many reStructuredText elements and common Sphinx roles (since v1.3.2), highly complex or obscure directives/roles might not render perfectly in the terminal environment as they would in Sphinx-generated HTML documentation. Test complex documents thoroughly.
fix
Simplify complex reStructuredText structures if rendering fidelity in the terminal is critical, or be prepared for minor visual discrepancies in highly advanced documents.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'rich_rst'
The rich-rst package has not been installed in the current Python environment or the environment is not correctly activated.
fix
pip install rich-rst
AttributeError: module 'rich_rst' has no attribute 'render'
The `rich_rst` module does not provide a top-level `render()` function; rendering is done by instantiating the `RestructuredText` class and printing it with a `rich.console.Console`.
fix
from rich_rst import RestructuredText
from rich.console import Console

console = Console()
rst_content = "Hello *World*!"
rst_renderer = RestructuredText(rst_content)
console.print(rst_renderer)
ImportError: cannot import name 'RestructuredTextRenderer' from 'rich_rst'
The main class for rendering reStructuredText is named `RestructuredText`, not `RestructuredTextRenderer`, and it is directly importable from the `rich_rst` package.
fix
from rich_rst import RestructuredText
# ... then use RestructuredText to render your content
Upgrade
Version history
2.1.0latest on PyPI · released Jul 5, 2026
Audit
Dependencies
richrequiredCore dependency for rich terminal rendering.
docutilsrequiredCore dependency for parsing reStructuredText documents.
Agent activity
9 hits · last 30 days
node
6
Resources
rich-rst — pip install rich-rst · libregistry