Registry / serialization / rst2ansi

rst2ansi

JSON →
library0.1.5pypypiunverified

rst2ansi is a Python library designed to convert reStructuredText (RST) documents into ANSI-decorated strings suitable for display in a terminal. The current version is 0.1.5, released in 2016. The project appears to be in maintenance mode with infrequent updates and known compatibility issues with newer dependencies.

pip install rst2ansi
INSTALL
IMPORT
SIG · RST2ANSI
R
rst2ansi
serializationpythonv0.1.5
Install
1.5s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.1.5 · 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.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

to_ansi
✓ from rst2ansi import to_ansi
✗ import rst2ansi

Converts a reStructuredText string to an ANSI-decorated console output, allowing for styled text in the terminal.

from rst2ansi import rst2ansi rst_text = """ Heading ======= This is **bold** and *italic* text. * List item 1 * List item 2 """ print(rst2ansi(rst_text))
rst2ansi --version
Debug
Known issues
breakingThe rst2ansi library is incompatible with recent versions of docutils (e.g., 0.19 and 0.22.3+). Specifically, docutils versions 0.19 and later deprecated and then removed the `docutils.utils.error_reporting` module, leading to `ImportError` or crashes when rst2ansi attempts to use `SafeString` or `ErrorString` from it.
fix
To resolve this, pin your `docutils` dependency to an older, compatible version (e.g., `docutils<0.19` or `docutils<0.22.3`). Alternatively, consider applying the unmerged patch from GitHub Pull Request #19 on the rst2ansi repository if you require a newer docutils version and are comfortable with manual patching.
affects: rst2ansi 0.1.5 with docutils 0.19 or newer (especially 0.22.3+)
gotchaThe library is largely unmaintained. The last official release was in May 2016, and its development status is listed as '4 - Beta' on PyPI. Critical dependency compatibility issues, such as those with docutils, have not been addressed in official releases.
fix
Be aware that the project may not receive future updates or bug fixes. If active development, broad compatibility with modern Python environments, or prompt issue resolution are critical, evaluate alternative libraries for reStructuredText rendering or ANSI formatting.
affects: All rst2ansi versions
Upgrade
Version history
0.1.5latest on PyPI · released May 24, 2016
Audit
Dependencies
docutilsrequiredRequired for parsing reStructuredText input.
Agent activity
20 hits · last 30 days
node
20
Resources
rst2ansi — pip install rst2ansi · libregistry