{"id":8608,"library":"rst2ansi","title":"rst2ansi","description":"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.","status":"maintenance","version":"0.1.5","language":"en","source_language":"en","source_url":"https://github.com/Snaipe/python-rst-to-ansi","tags":["rst","reStructuredText","ansi","console","terminal","text formatting","markup","docutils"],"install":[{"cmd":"pip install rst2ansi","lang":"bash"}],"dependencies":[{"reason":"Required for parsing reStructuredText input.","package":"docutils","optional":false}],"imports":[{"symbol":"rst2ansi","correct":"from rst2ansi import rst2ansi"}],"quickstart":{"code":"from rst2ansi import rst2ansi\n\nrst_text = \"\"\"\nHeading\n=======\n\nThis is **bold** and *italic* text.\n\n* List item 1\n* List item 2\n\"\"\"\n\nprint(rst2ansi(rst_text))","lang":"python","description":"Converts a reStructuredText string to an ANSI-decorated console output, allowing for styled text in the terminal."},"warnings":[{"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.","message":"The 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.","severity":"breaking","affected_versions":"rst2ansi 0.1.5 with docutils 0.19 or newer (especially 0.22.3+)"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"All rst2ansi versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Downgrade your `docutils` package to a version older than 0.19 (e.g., `pip install 'docutils<0.19'`) or a version older than 0.22.3 (e.g., `pip install 'docutils<0.22.3'`) to ensure compatibility with rst2ansi.","cause":"The rst2ansi library attempts to import `SafeString` or `ErrorString` from `docutils.utils.error_reporting`, which was deprecated in docutils 0.19 and removed in docutils 0.22.3 and later versions.","error":"ImportError: cannot import name 'SafeString' from 'docutils.utils.error_reporting'"},{"fix":"Install the `docutils` package using pip: `pip install docutils`.","cause":"The `docutils` package, which is a core dependency for `rst2ansi` to parse reStructuredText, is not installed in your Python environment.","error":"ImportError: No module named docutils"}]}