Open leotulipan opened 1 year ago
the problem is that every service offers recipes in a different format. Thats why we have customer import scripts for so many different applications.
You could write a small script to parse the recipes and send them to the tandoor API. We could also put it on the roadmap to build an importer into tandoor that imports from that format, although if you want that I would need to better understand what this application is that produces this data.
Thanks for the quick reply @vabene1111 !
Couldn't you define a "generic" JSON Import from a Recipe in https://schema.org/Recipe format.
The RecipeSage JSON nearly does that, but it is missing nutrition info.
I tried adding it like this:
"nutrition": {
"@type": "NutritionInformation",
"servingSize": "1 Bread",
"calories": "1375 Calories",
"carbohydrateContent": "97g",
"proteinContent": "171g",
"fatContent": "31g",
"saturatedFatContent": "2g",
"sodiumContent": "3264mg"
}
but this section is simply ignored on import.
So my proposal is to have one generic JSON import option that also included a fully complete sample json recipe that uses ALL available fields.
That way writing a converter is easy.
Next Step: Where do I find info on how to add a converter and/or which of the current imports is most feature complete and especially supports nutrition data?
I renamed the Issue from "JSON WPRM (Bootstrapped Venture WP Recipe Maker Wordpress) workflow/support" to "FEATURE REQUEST: JSON Import with Nutritional Data"
Essentially what I can see is missing with all (?) current App importers that support json, that they do not import or honour nutritional info.
As there is a schema for recipe and a format for nutritional data it would be good to have one demo implementation which imports ALL data points that a recipe can have (and that Tandoor supports) including nutrition.
I'd be happy to help with this, if I'd only knew where to start...
So tandoor supports as many data points as a user could wish for.
Some importers (I think nextcloud for example) are already able to import nutritional data (called properties in tandoor)
This needs to be added to all the importers where the source application contains the required data.
Additonally to address your need we could add a generic schema. Json importer with a specified format of how multiple recipes can be provided and how images can be included (probably need both file and link based).
The importer needs some overhaul I don't really like the overall architecture but I think it should be doable with the current state
Dear @vabene1111
I'd like to share some feedback and suggestions that might help improve the importer for Tandoor. Here are my thoughts structured for clarity:
Nextcloud Recipe Example: It appears that a full recipe example from Nextcloud is absent both in Tandoor and in Nextcloud itself. Consequently, for someone like me, creating a manual JSON file compatible with Nextcloud’s format becomes a cumbersome process. It essentially means I'd need to set up Nextcloud, the cookbook plugin, create a recipe, and then export it. If there's an example nestled within test cases or elsewhere, it would be beneficial to highlight its location. An exemplar would indeed simplify the process for writing a converter since Nextcloud seems to have the most comprehensive JSON format importer.
Towards a Generic Schema: Considering Nextcloud’s adherence to the JSON recipe schema standard, it could be a solid foundation for a generic schema. What would be immensely valuable is an exhaustive example recipe JSON – covering everything from dish specifics, nutritional data, ingredients, steps, cuisine, image, etc (so all features that TandoorRecipes supports). Having such an all-encompassing template would set a clear benchmark for anyone wanting to import their recipes.
Challenges without Nextcloud: As I don't have Nextcloud set up, acquiring a recipe has become a challenge. I haven’t found the time to initiate a Docker container with Nextcloud just for the sake of extracting a recipe JSON export. So, if there's any community member with access, it would be fantastic if they could share a sample.
Summing it up: To reiterate, Nextcloud seems poised as the most well-rounded importer. Pair this with the existing"official" JSON recipe schema, and we might be onto something big. A thorough documentation of a Nextcloud JSON recipe would pave the way for most of the journey. Then writing a python converter script to transform various exports – be it from WordPress or any other source – into this standardized, feature-complete JSON would be way easier.
Concluding, the crux of the matter is having a comprehensive template JSON recipe which then acts as a guidepost for everyone. By doing this, I believe we'd be streamlining and simplifying the entire import process for users, ensuring a more consistent and efficient experience.
Looking forward to your thoughts and further collaboration on this.
hi, many good ideas. will keep them in mind when re-working the importer system
Hi Ben, I would like to add:
Tandoor Version
cloud (latest version)
Import URL
https://demo.wprecipemaker.com/wprm-recipe-export.json
When did the issue happen?
The demo json recipe is at https://demo.wprecipemaker.com/wprm-recipe-export.json and I tried importing this manually but it says "error fetching resource"
Isnt there a default JSON APP I can select to get this to work. I have an export with 147 recipes I need to import.
[ { "id": 41, "type": "food", "image_url": "https:\/\/demo.wprecipemaker.com\/wp-content\/uploads\/2018\/10\/baked-beer-cheese-724216.jpg", "pin_image_url": "https:\/\/demo.wprecipemaker.com\/wp-content\/uploads\/2018\/10\/baked-beer-cheese-724216.jpg", "name": "Amazing Vegetable Pizza", "summary": "<p>Every night can be pizza night, if you ask me. Just throw whatever vegetable leftovers you have on there and enjoy!<\/p>", "author_display": "disabled", "author_name": "", "author_link": "", "cost": "", "servings": "2", "servings_unit": "pizzas", "prep_time": "15", "prep_time_zero": "", "cook_time": "15", "cook_time_zero": "", "total_time": "60", "custom_time": "30", "custom_time_zero": "", "custom_time_label": "Resting Time", "tags": { "course": [ "Pizza" ], "cuisine": [ "Italian" ], "keyword": [ "Vegetarian" ], "difficulty": [] }, "equipment": [ { "name": "Pizza Stone" } ], "ingredients_flat": [ { "name": "Pizza Dough", "type": "group" }, { "amount": "1", "unit": "cup", "name": "water", "notes": "lukewarm", "converted": { "2": { "amount": "250", "unit": "ml" } }, "type": "ingredient" }, { "amount": "2", "unit": "cups", "name": "all-purpose flour", "notes": "", "converted": { "2": { "amount": "500", "unit": "g" } }, "type": "ingredient" }, { "amount": "1", "unit": "tsp", "name": "instant yeast", "notes": "", "converted": { "2": { "amount": "1", "unit": "tsp" } }, "type": "ingredient" }, { "amount": "1", "unit": "tsp", "name": "salt", "notes": "", "converted": { "2": { "amount": "1", "unit": "tsp" } }, "type": "ingredient" }, { "amount": "1", "unit": "tsp", "name": "sugar", "notes": "", "converted": { "2": { "amount": "1", "unit": "tsp" } }, "type": "ingredient" }, { "name": "Pizza Toppings", "type": "group" }, { "amount": "", "unit": "", "name": "red sauce", "notes": "", "converted": { "2": { "amount": "", "unit": "" } }, "type": "ingredient" }, { "amount": "1\/4", "unit": "", "name": "red onion", "notes": "", "converted": { "2": { "amount": "0.25", "unit": "" } }, "type": "ingredient" }, { "amount": "1\/4", "unit": "", "name": "green pepper", "notes": "", "converted": { "2": { "amount": "0.25", "unit": "" } }, "type": "ingredient" }, { "amount": "1\/4", "unit": "", "name": "red pepper", "notes": "", "converted": { "2": { "amount": "0.25", "unit": "" } }, "type": "ingredient" }, { "amount": "", "unit": "", "name": "rosemary", "notes": "", "converted": { "2": { "amount": "", "unit": "" } }, "type": "ingredient" } ], "instructions_flat": [ { "text": "<p>Combine the water, yeast and sugar in a bowl. Rest for 5 minutes.<\/p>", "type": "instruction", "image_url": "" }, { "text": "<p>Combine the flour and salt.<\/p>", "type": "instruction", "image_url": "" }, { "text": "<p>Add the yeast mixture and knead until you get a soft ball.<\/p>", "type": "instruction", "image_url": "" }, { "text": "<p>Place in a bowl and cover. Let rise for 30 minutes.<\/p>", "type": "instruction", "image_url": "" }, { "text": "<p>Divide the dough and form pizzas.<\/p>", "type": "instruction", "image_url": "https:\/\/demo.wprecipemaker.com\/wp-content\/uploads\/2018\/10\/bake-baker-bakery-1251179.jpg" }, { "text": "<p>Top the pizzas with sauce and vegetables, cook for 15 minutes on the pizza stone.<\/p>", "type": "instruction", "image_url": "" } ], "video_embed": "", "notes": "<p>Feel free to swap any of the topping in the ingredient list with whatever you have lying around. It will probably taste just as amazing!<\/p>\n", "nutrition": { "calories": 482, "carbohydrates": 101, "protein": 14, "fat": 1, "saturated_fat": 0, "cholesterol": 0, "sodium": 1174, "potassium": 230, "fiber": 4, "sugar": 4, "vitamin_a": 520, "vitamin_c": 32, "calcium": 19, "iron": 5.8 }, "custom_fields": { "inspiration": "" }, "ingredient_links_type": "global" } ]
Response / message shown
No response