striprtf is a simple Python library designed to convert Rich Text Format (RTF) files or strings into plain text. It focuses on handling various RTF parsing challenges, including automatic encoding detection (with a default of 'cp1252'), Unicode decoding, and the removal of binary data. The library is currently at version 0.0.29, released on March 27, 2025, and maintains an active release cadence.
pip install striprtfVerified import paths — ran on the pinned version, not inferred.
Convert an RTF formatted string directly to plain text. The `rtf_to_text` function is the primary interface. You can specify the encoding if different from the default 'cp1252'.
Ensure your environment uses Python 3.8 or newer. Upgrade your Python interpreter if necessary.
Always check your RTF file's expected encoding. Pass the `encoding` parameter to `rtf_to_text` if it differs from the default or if you encounter decoding issues. For `errors` handling, ensure you are on `v0.0.25` or newer.
For critical applications with varied or complex RTF inputs, perform thorough testing with representative samples. Consider pre-processing malformed RTF or using more robust, enterprise-grade RTF parsers if full fidelity is required for all RTF complexities.
No dependency data recorded yet.