A powerful and versatile tool for converting documents to PDF and Word formats. Heya supports converting HTML, Markdown, WeChat articles to PDF, and PDF to Word documents.
Supports three ways to use: Command Line Interface, Web Interface, and Desktop Application.
- Multi-format Conversion: Convert HTML, Markdown, WeChat articles to PDF
- PDF to Word: Convert PDF documents to editable Word (.docx) files
- Batch Processing: Convert multiple files at once
- PDF Merging: Merge multiple PDF files into one
- Quality Control: Optional compression with configurable quality levels
- Three Interfaces:
- CLI Tool: Perfect for automation and scripts
- Web Interface: User-friendly Gradio UI
- Desktop Application: Native PySide6 application
- Multi-language Support: Chinese, English, Korean
pip install heyapip install heya[web]pip install heya[app]pip install heya[web,app]playwright install chromium# HTML to PDF
heya html2pdf -i https://example.com -o output.pdf
# Markdown to PDF
heya md2pdf -i README.md -o output.pdf
# WeChat Articles to PDF
heya wechat2pdf -i "https://mp.weixin.qq.com/s/xxx" -o output_dir/
# PDF to Word
heya pdf2word -i document.pdf -o output.docxheya webThe web server starts on http://127.0.0.1:7860 by default.
heya appheya html2pdf -i <url or file path> -o <output path> [options]Options:
-i, --input: Source URL or HTML file path (supports multiple inputs)-o, --output: Output directory path-t, --timeout: Timeout in seconds (default: 30.0)-q, --quality: Compression quality: 0=high, 1=medium, 2=low (default: 0)-m, --merge: Merge all PDFs into one file
Examples:
# Single file
heya html2pdf -i https://example.com -o output.pdf
# Batch conversion
heya html2pdf -i page1.html -i page2.html -i page3.html -o pdfs/
# Merge output
heya html2pdf -i page1.html -i page2.html -o merged.pdf --mergeheya md2pdf -i <file path> -o <output path> [options]Options:
-i, --input: Markdown file path (supports multiple inputs)-o, --output: Output directory path-t, --timeout: Timeout in seconds-q, --quality: Compression quality-m, --merge: Merge all PDFs into one file
Examples:
heya md2pdf -i README.md -o output.pdf
heya md2pdf -i *.md -o pdfs/ --mergeheya wechat2pdf -i <wechat link> -o <output directory> [options]Options:
-i, --input: WeChat article URL-o, --output: Output directory path-t, --timeout: Timeout in seconds-q, --quality: Compression quality-m, --merge: Merge all PDFs into one file
Supports:
- Single article URL:
https://mp.weixin.qq.com/s/xxx - Article list URL:
https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=xxx
Examples:
# Convert single article
heya wechat2pdf -i "https://mp.weixin.qq.com/s/xxx" -o articles/
# Convert article list (batch)
heya wechat2pdf -i "https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=xxx" -o articles/heya pdf2word -i <pdf file> -o <output path>Options:
-i, --input: Source PDF file path-o, --output: Output Word file path
Example:
heya pdf2word -i document.pdf -o output.docx- Multi-tab Interface: Separate tabs for each conversion type
- Drag & Drop: Upload files by dragging and dropping
- Batch Processing: Convert multiple files at once
- PDF Merging: Merge multiple PDFs into a single file
- Quality Settings: Configure compression quality and timeout
- Multi-language Support: English, Chinese, and Korean
- Error Handling: Clear error messages with issue reporting
- Native Interface: Built with PySide6 for native desktop experience
- Offline Use: Core features work without internet
- Multi-language Support: Chinese, English, Korean supported
- Real-time Progress: Live conversion progress display
heya/
├── heya/ # Main package
│ ├── app/ # Desktop application
│ │ ├── components/ # UI components
│ │ ├── core # Core components
│ │ ├── handlers # Event handlers
│ │ ├── i18n # Internationalization
│ │ ├── services # Service layer
│ │ └── utils # Utility functions
│ ├── cmd/ # CLI commands
│ │ └── commands # Command implementations
│ ├── core/ # Core conversion logic
│ │ ├── browser # Browser management
│ │ ├── cache # Caching
│ │ ├── config # Configuration
│ │ ├── converters # Converters
│ │ ├── exceptions # Exceptions
│ │ ├── helpers # Helper functions
│ │ ├── interfaces # Interfaces
│ │ ├── logging # Logging
│ │ ├── markdown # Markdown processing
│ │ ├── models # Data models
│ │ ├── pdf # PDF operations
│ │ ├── performance # Performance optimization
│ │ ├── stream_converters # Stream converters
│ │ ├── temp # Temporary files
│ │ ├── template # Templates
│ │ └── wechat # WeChat processing
│ └── web/ # Web application
│ ├── components # UI components
│ ├── config # Configuration
│ ├── core # Core
│ ├── handlers # Event handlers
│ ├── i18n # Internationalization
│ ├── services # Service layer
│ └── utils # Utility functions
├── pyproject.toml # Project configuration
└── README.md # This file
# Clone the project
git clone https://github.com/zkep/heya.git
cd heya
# Sync dependencies with uv
uv sync
# Activate virtual environment
source .venv/bin/activateuv run pytestuv run mypy heyauv run ruff check heya
uv run ruff format heya- click: Command-line interface framework
- playwright: Browser automation for HTML/WeChat conversion
- markdown: Markdown parsing
- pypdf: PDF manipulation
- reportlab: PDF generation and merging
- gradio: Web UI (optional)
- PySide6: Desktop application (optional)
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please open an issue on GitHub.
- Built with Playwright for reliable browser automation
- Web UI powered by Gradio
- Desktop application powered by PySide6