RTF libraries for Python
- striprtf converts RTF to plain text with one function call. It’s small, pure Python, actively maintained and handles code pages, Unicode escapes and simple tables. It doesn’t keep formatting.
For other RTF tasks in Python: rtfde and rtfparse extract HTML encapsulated by Outlook from RTF email bodies; Pandoc (via pypandoc) converts RTF to Markdown, HTML or DOCX; and LibreOffice (soffice --headless --convert-to) converts with full formatting. There’s no maintained pure Python library that writes RTF with an object model; generating RTF text directly is common.
- striprtf striprtf converts RTF to plain text in Python. How to install it, extract text from an RTF file, handle code pages and encoding errors, and process many files.