Choose python-docx when: (+4)
Choose python-docx when:
- Creating reports, contracts, or documentation from scratch
- Modifying existing Word documents programmatically
- Need full control over document structure and styling
- Generating documents with complex formatting requirements
Choose openpyxl when:
- Automating Excel report generation
- Reading and processing spreadsheet data
- Creating workbooks with formulas and charts
- Batch processing multiple Excel files
Choose python-pptx when:
- Generating presentations from data automatically
- Creating slide decks with consistent branding
- Building presentation templates with dynamic content
- Automating reporting dashboards as slides
Choose pypdf when:
- Merging multiple PDFs into one document
- Extracting text or pages from PDF files
- Adding watermarks or page numbers
- Splitting large PDFs into smaller files
Choose docx-templates when:
- Filling template documents with database records
- Generating bulk documents (letters, invoices, contracts)
- Non-developers need to maintain document templates
- Jinja2-style syntax is preferred for templates