Professional document generation with configurable theming — PDF, Word, and multi-format export.
Built by Hidden Leaf Networks.
pip install docforge
# With optional format support
pip install docforge[word] # Word (.docx) generation
pip install docforge[excel] # Excel (.xlsx) export
pip install docforge[all] # Everythingfrom docforge import DocumentGenerator, Theme
# Custom theme
theme = Theme(
brand_name="Acme Corp",
primary="#3B82F6",
footer_text="Generated by Acme Corp",
)
gen = DocumentGenerator(theme=theme)
# Generate PDF from markdown
gen.create_pdf(
"report.pdf",
title="Q1 Report",
content="## Summary\n\nRevenue increased **15%** year-over-year.",
metadata={"author": "Jane Doe", "organization": "Acme Corp"},
)- Configurable themes — Colors, fonts, margins, branding
- Professional PDF generation — Cover pages, headers, footers, page numbers
- Markdown parsing — Headings, bold, italic, code, lists, horizontal rules
- Word document generation — Structured sections with metadata tables
- Multi-format chat export — TXT, PDF, CSV, XLSX with styled output
- Component library — Reusable flowables for custom document layouts
Every visual aspect is configurable through the Theme class:
from docforge import Theme
theme = Theme(
name="corporate",
brand_name="Acme Corp",
primary="#1E40AF", # Header and accent color
secondary="#F59E0B", # Secondary accent
text_dark="#1F2937", # Body text
footer_text="Confidential — Acme Corp",
footer_url="acme.com",
font_body="Helvetica",
font_heading="Helvetica-Bold",
)Export conversations to multiple formats:
from docforge.export import ChatExportService, ChatMessage, ExportMetadata
messages = [
ChatMessage(role="user", content="What's the status?"),
ChatMessage(role="assistant", content="All systems operational."),
]
metadata = ExportMetadata(title="Support Chat", brand_name="Acme Corp")
# Export to any supported format
ChatExportService.export(messages, metadata, fmt="pdf", export_dir="./exports")
ChatExportService.export(messages, metadata, fmt="xlsx", export_dir="./exports")MIT License — see LICENSE for details.
Built with intention by Hidden Leaf Networks — an applied AI studio.