Bakepedia includes both a local FastAPI web interface and the original RecipeR command-line
workflow. Give either interface a public recipe webpage: it extracts the recipe data, uses an
OpenAI model to clean and organize the content, and presents a source-linked recipe. The web app
and CLI both generate the same formatted Microsoft Word .docx. When the webpage includes a
YouTube tutorial, its link is retained.
The generated file always puts the recipe sections in this order:
INGREDIENTS, with detailed amounts, units, ingredient types, alternatives, and preparation notes retained as strings.INSTRUCTIONS, numbered in cooking order and preserving stated times, temperatures, dimensions, quantities, equipment settings, and visual cues.TIPS, included only when the source contains supported notes, substitutions, storage advice, or similar guidance.
RecipeR performs one bounded webpage fetch, looks first for Schema.org Recipe JSON-LD, then
tries microdata and common recipe-card markup. It also keeps a size-limited article excerpt so tips
outside the recipe card are available. YouTube watch links and embeds are detected directly from
the source and normalized to a standard video URL. The extracted recipe material is sent to the
OpenAI Responses API and parsed directly into a Pydantic schema. Python—not the model—controls the
video link, numbering, wrapping, filenames, and final text formatting.
Webpage text is treated as untrusted data. The normalizer is told not to follow embedded prompts, invent missing facts, or convert measurements. After structured parsing, RecipeR restores the lossless source ingredient and instruction lines, keeps source metadata in its original field, and restores explicit recipe-card notes and recognized tip sections. It refuses output if item counts change or unsupported numeric details appear; model-proposed tips are not trusted as source facts.
- Python 3.11 or newer
- An OpenAI API key configured in
.envor the shell environment - Internet access to both the recipe website and the OpenAI API
python3 -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -e '.[dev]'Create your local configuration file, then add your existing API key to it:
cp .env.example .envYou can also set OPENAI_API_KEY in your shell. Never commit a real key.
Recommended models for Bakepedia:
- Testing:
gpt-5.4-nanofor inexpensive development and test runs. - Daily use:
gpt-5.4-minifor a practical balance of accuracy, speed, and cost. This is Bakepedia's default. - More reliable:
gpt-5.6-lunawhen you want to prioritize successful extraction over cost.
All three support the Responses API and structured outputs. Bakepedia's validation rejects results that alter source item counts or introduce unsupported numeric details.
Bakepedia uses low reasoning effort; this extraction task does not normally require additional
reasoning. Change the model in .env:
OPENAI_MODEL=gpt-5.4-miniYou can also override it for one run with --model MODEL.
On macOS, double-click Bakepedia.app in this folder. The mixing-bowl app icon wraps the simple
Launch Bakepedia.command launcher: it starts the local server and opens
http://localhost:8000 in the default browser. Keep the Terminal window
open while using Bakepedia; closing it stops the server.
Or start the FastAPI interface manually:
.venv/bin/python web.pyThen open http://localhost:8000. Paste a recipe URL from
sallysbakingaddiction.com, review the clean recipe, and choose Download Word document for a
formatted .docx file. The web importer rejects other domains. Recipe previews are held briefly
in memory and are cleared when the server restarts. The API key stays in the local Python process
and is never sent to browser code.
Run the Python script and paste a public recipe URL when prompted:
.venv/bin/python run.pyYou can also provide the URL directly:
.venv/bin/python run.py \
'https://sallysbakingaddiction.com/homemade-artisan-bread/'By default, Bakepedia writes outputs/<recipe-title>.docx and prints the absolute output path. To
choose a path:
.venv/bin/python run.py 'https://example.com/recipe' --output outputs/dinner.docxExisting files are protected. Add --overwrite when replacement is intentional:
.venv/bin/python run.py 'https://example.com/recipe' -o outputs/dinner.docx --overwriteOther options:
--model MODEL Override OPENAI_MODEL for this run
--debug Show a traceback when diagnosing a failure
Recipe Title
============
Source: https://example.com/recipe
YouTube tutorial: https://www.youtube.com/watch?v=abc123XYZ_-
Yield: 1 loaf
Prep time: 1 hour 30 minutes
Cook time: 25 minutes
INGREDIENTS
- 2 cups (250 g) example ingredient, finely chopped
INSTRUCTIONS
1. Heat the oven to 400°F (204°C), then cook for 20–25 minutes.
TIPS
- Store in an airtight container for up to 3 days.
Ingredients use real Word bullets and instructions use real numbering so wrapped lines stay easy
to scan. The Tips heading is omitted when the source has no tips.
All normal tests are offline and use synthetic recipe pages plus a fake LLM client:
.venv/bin/ruff check .
.venv/bin/python -m pytestThe OpenAI call cannot be tested until an API key is configured. Scraping also depends on what a site publicly returns at the time of the request; JavaScript-only, login-protected, paywalled, or bot-blocked pages may not be extractable, and RecipeR does not bypass those controls.
- Only public
http://andhttps://destinations are accepted. Private, loopback, link-local, and other non-public addresses are rejected, including at redirect hops. - Responses must be HTML and are limited to 3 MiB, five redirects, and bounded retry/timeout behavior.
- URL query strings are not written to the output file.
- The cleaned recipe material is sent to OpenAI for processing. Do not use RecipeR on content you are not permitted to access or transmit.
- Always review generated cooking instructions for allergens, food-safety requirements, and source accuracy before relying on them.
run.py direct Python script entry point
web.py localhost FastAPI entry point
src/reciper/ application package, views, and static assets
tests/ offline unit and mocked pipeline tests
outputs/ default location for generated .docx recipes
.env.example safe local configuration template
pyproject.toml package, dependency, test, and lint configuration