Extract recipes from EPUB cookbooks to Mela format.
This tool is for personal use. You must have the right to use any content you process. It does not bypass copy protection. The authors accept no liability for misuse.
- 📚 EPUB Parsing - Extract recipes from EPUB cookbook files
- 🤖 AI-Powered - Uses OpenAI GPT models for intelligent recipe extraction
- 📝 Structured Output - Exports to Mela-compatible JSON format
- 🎯 Accurate Extraction - Chapter-based processing for precise recipe boundaries
- 🧪 Well-Tested - Comprehensive test suite with validation against expected outputs
# Install as a UV tool (recommended)
uv tool install git+https://github.com/gwhthompson/mela_parser.git
# Or install from local directory
cd mela_parser
uv tool install .
# For development
uv sync --all-extras# Extract recipes from an EPUB cookbook
mela-parse path/to/cookbook.epub
# With options
mela-parse cookbook.epub --model gpt-5-mini --output-dir my_recipes--model: Choose OpenAI model (gpt-5-nano[default] orgpt-5-mini)--output-dir: Output directory (default:output)--no-images: Skip image extraction
mela_parser/
├── src/mela_parser/ # Core package
│ ├── cli.py # CLI entry point
│ ├── parse.py # Recipe parsing with OpenAI
│ ├── recipe.py # Recipe processing and EPUB handling
│ ├── converter.py # EPUB to Markdown conversion
│ ├── chapter_extractor.py # Chapter-based extraction pipeline
│ ├── validator.py # Recipe quality validation
│ └── image_processor.py # Image extraction and processing
├── tests/ # Test suite
├── examples/ # Sample cookbooks and outputs
├── docs/ # Documentation
└── Makefile # Common development tasks
# Install development dependencies
uv sync --all-extras
# Run tests
make test
# Run linter
make lint
# Format code
make format
# Run CLI locally (without installing)
uv run mela-parse path/to/your-cookbook.epubThe project includes comprehensive tests for recipe extraction accuracy:
# Run all tests
uv run pytest
# Run with coverage
make test-cov
# Run specific test file
uv run pytest tests/test_extraction.py -vTest targets verify extraction accuracy against your own EPUB cookbooks.
- Chapter Conversion: EPUB chapters are converted to clean markdown
- Parallel Extraction: Extracts recipes from all chapters simultaneously using async processing
- Deduplication: Removes duplicate recipes based on title
- Export: Saves recipes in Mela-compatible
.melarecipesformat
- Python 3.13+
- OpenAI API key (set as
OPENAI_API_KEYenvironment variable) - UV package manager (for installation)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with MarkItDown for EPUB conversion
- Uses OpenAI API for intelligent recipe extraction
- Designed for Mela recipe manager
✅ Production Ready - Chapter-based extraction with async parallel processing for optimal speed and accuracy.