Paprika Recipe Importer
Convert recipe content (any format/language) into a .paprikarecipes file for Paprika 3.
Workflow
- 1. Extract recipe fields from the input (text, image, transcript, URL content).
- Build a JSON recipe object — only include fields actually present in the source; do NOT invent values.
- Run the packaging script to produce the
.paprikarecipes file. - Deliver the file to the user.
Step 1 — Extract Fields
Parse the input and populate only the fields that exist in the source:
| JSON field | Notes |
|---|
| INLINECODE2 | Recipe title. Required. |
| INLINECODE3 |
Newline-separated list. Format:
quantity unit ingredient. |
|
directions | Newline-separated steps. |
|
description | Intro/summary paragraph, if present. |
|
notes | Tips, variations, author notes. |
|
servings | e.g.
"4 porções" or
"serves 6" |
|
prep_time | e.g.
"15 min" |
|
cook_time | e.g.
"30 min" |
|
total_time | e.g.
"45 min" |
|
source | Author name, site name, person. |
|
source_url | Original URL, if available. |
|
categories | JSON array of strings, e.g.
["Jantar", "Massas"] |
|
difficulty |
"Easy",
"Medium", or
"Hard" — only if explicitly stated. |
|
rating | Integer 1–5 — only if explicitly stated. |
|
nutritional_info| Any nutritional data present. |
Rules:
- - Never fabricate values not present in the source.
- Keep the original language (Portuguese, English, mixed — whatever the source uses).
- Ingredients: one per line, preserve quantities and units exactly.
- Directions: one step per line; numbered steps → strip the number (Paprika handles display).
Step 2 — Build JSON
Write the recipe as a JSON file to a temp path, e.g. /tmp/<recipe-name>.json.
Step 3 — Run the Script
CODEBLOCK0
The script accepts a single JSON object or a JSON array (for multiple recipes).
Step 4 — Deliver
Send the .paprikarecipes file to the user. Mention:
- - How to import: File → Import in Paprika (or double-click the file on macOS/iOS).
- Which fields were found and which were absent from the source.
Paprika Recipe Importer
将食谱内容(任何格式/语言)转换为适用于 Paprika 3 的 .paprikarecipes 文件。
工作流程
- 1. 提取 输入内容(文本、图片、转录文本、URL 内容)中的食谱字段。
- 构建 JSON 食谱对象——仅包含源文件中实际存在的字段;不得编造值。
- 运行 打包脚本以生成 .paprikarecipes 文件。
- 交付 将文件提供给用户。
步骤 1 — 提取字段
解析输入内容,仅填充源文件中存在的字段:
| JSON 字段 | 说明 |
|---|
| name | 食谱标题。必填。 |
| ingredients |
以换行符分隔的列表。格式:数量 单位 食材。 |
| directions | 以换行符分隔的步骤。 |
| description | 简介/摘要段落(如有)。 |
| notes | 提示、变体、作者备注。 |
| servings | 例如 4 份 或 供 6 人食用 |
| prep_time | 例如 15 分钟 |
| cook_time | 例如 30 分钟 |
| total_time | 例如 45 分钟 |
| source | 作者姓名、网站名称、个人。 |
| source_url | 原始 URL(如有)。 |
| categories | JSON 字符串数组,例如 [晚餐, 面食] |
| difficulty | 简单、中等 或 困难——仅当明确说明时。 |
| rating | 整数 1–5——仅当明确说明时。 |
| nutritional_info | 存在的任何营养数据。 |
规则:
- - 绝不编造源文件中不存在的值。
- 保留原始语言(葡萄牙语、英语、混合语言——无论源文件使用何种语言)。
- 食材:每行一个,精确保留数量和单位。
- 步骤:每行一个步骤;带编号的步骤 → 去除编号(Paprika 会处理显示)。
步骤 2 — 构建 JSON
将食谱写入临时路径下的 JSON 文件,例如 /tmp/<食谱名称>.json。
步骤 3 — 运行脚本
bash
python3 ~/.openclaw/skills/paprika-recipe-importer/scripts/build_paprikarecipes.py \
/tmp/<食谱名称>.json \
/tmp/<食谱名称>.paprikarecipes
该脚本接受单个 JSON 对象或 JSON 数组(用于多个食谱)。
步骤 4 — 交付
将 .paprikarecipes 文件发送给用户。提及:
- - 如何导入:在 Paprika 中通过 文件 → 导入(或在 macOS/iOS 上双击文件)。
- 源文件中找到了哪些字段,缺少了哪些字段。