{"library":"pyrtf3","title":"PyRTF3","description":"PyRTF3 is a fork of the original PyRTF library, providing a Pythonic way to generate Rich Text Format (RTF) documents. It allows users to programmatically create complex RTF files including text, paragraphs, sections, tables, lists, and styling. The current version is 0.47.5, with releases occurring periodically to address issues and maintain compatibility.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install pyrtf3"],"cli":null},"imports":["from pyrtf.document import Document","from pyrtf.document import Section","from pyrtf.document import Paragraph","from pyrtf.document import Text","from pyrtf.document import Table"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom pyrtf.document import Document, Section, Paragraph, Text\n\ndef create_simple_rtf():\n    doc = Document()\n    section = Section()\n    doc.append(section)\n\n    section.append(Paragraph(Text('Hello, PyRTF3!')))\n    section.append(Paragraph(Text('This is a simple RTF document generated with Python.')))\n\n    output_filename = 'simple_pyrtf3_document.rtf'\n    with open(output_filename, 'wb') as f:\n        doc.write(f)\n\n    print(f\"RTF document '{output_filename}' created successfully.\")\n\nif __name__ == '__main__':\n    create_simple_rtf()","lang":"python","description":"This quickstart creates a basic RTF document with two paragraphs of text and saves it to a file named 'simple_pyrtf3_document.rtf'. It demonstrates the core Document, Section, Paragraph, and Text objects.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}