From b9795a80eb4db73e1b281f1ab291ff7717d17c4b Mon Sep 17 00:00:00 2001 From: Joey <7505194+jknndy@users.noreply.github.com> Date: Fri, 4 Oct 2024 06:53:43 -0700 Subject: [PATCH 1/2] Cleanup of a few test files (#1255) --- .../allrecipes.com/allrecipescurated.json | 6 +++--- .../ottolenghibooks_1.json | 18 ------------------ .../ottolenghibooks_2.json | 3 ++- .../cookscountry.com/cookscountry.json | 17 ++++++++++++++++- .../cooksillustrated.com/cooksillustrated.json | 13 ++++++++++++- .../dobruchutaktualitysk.json | 3 +++ .../mundodereceitasbimby_1.json | 17 ----------------- .../panelinha.com.br/panelinha_1.json | 2 +- 8 files changed, 37 insertions(+), 42 deletions(-) diff --git a/tests/test_data/allrecipes.com/allrecipescurated.json b/tests/test_data/allrecipes.com/allrecipescurated.json index 25366fa70..bdf346160 100644 --- a/tests/test_data/allrecipes.com/allrecipescurated.json +++ b/tests/test_data/allrecipes.com/allrecipescurated.json @@ -25,9 +25,9 @@ "category": "Dinner", "yields": "8 servings", "description": "These delicious four cheese pizzas are bursting with flavor, and ready in under one hour.", - "total_time": 40.0, - "cook_time": 10.0, - "prep_time": 15.0, + "total_time": 40, + "cook_time": 10, + "prep_time": 15, "cuisine": "Italian Inspired", "ratings": 4.8, "ratings_count": 489, diff --git a/tests/test_data/books.ottolenghi.co.uk/ottolenghibooks_1.json b/tests/test_data/books.ottolenghi.co.uk/ottolenghibooks_1.json index 63e122a50..642d7ea05 100644 --- a/tests/test_data/books.ottolenghi.co.uk/ottolenghibooks_1.json +++ b/tests/test_data/books.ottolenghi.co.uk/ottolenghibooks_1.json @@ -18,23 +18,6 @@ "100g unsalted butter, fridge cold and cut into 2cm cubes", "salt and black pepper" ], - "ingredient_groups": [ - { - "ingredients": [ - "300g dried chickpeas, soaked overnight in plenty of water and 1 tsp bicarbonate of soda", - "3 tbsp olive oil", - "8 garlic cloves, crushed", - "80g Parmesan, finely grated, plus 1–2 optional Parmesan rinds (60g)", - "¼ tsp bicarbonate of soda", - "2 red chillies, thinly sliced into rounds, seeds and all", - "2 tbsp apple cider vinegar", - "250g baby spinach", - "15g parsley, roughly chopped", - "100g unsalted butter, fridge cold and cut into 2cm cubes", - "salt and black pepper" - ] - } - ], "instructions_list": [ "Preheat the oven to 160°C fan.", "Drain the chickpeas well and set them aside. Put 2 tablespoons of oil into a large, high-sided ovenproof sauté pan or cast-iron saucepan, for which you have a lid, and place on a medium-high heat. Once hot, add the garlic and cook for 90 seconds, until starting to colour. Add the Parmesan rinds, if using, the drained chickpeas, bicarbonate of soda, 1.2 litres of water and a very generous amount of coarsely cracked black pepper (give it about 40 grinds). Bring to the boil, skimming the scum from the surface as needed, then cover with the lid and bake in the oven for 75 minutes. Add ¾ teaspoon of salt and continue cooking, covered, for another 30 minutes, or until the chickpeas are very soft and the liquid has reduced by about half.", @@ -46,7 +29,6 @@ "category": "Pulses & Grains", "yields": "4 servings", "description": "These chickpeas are inspired by cacio e pepe, a rich Italian dish of pasta coated in lavish amounts of butter, black pepper and cheese. This uses a similar technique applied to our favourite little bean, using the flavourful Parmesan chickpea water to create the emulsified sauce.\nChickpeas differ in size depending on where you are in the world, so if you feel that this should be a little looser, just add a splash of water. Be sure to start the night before by soaking your chickpeas.", - "dietary_restrictions": [], "image": "https://books.ottolenghi.co.uk/wp-content/uploads/2021/08/121_CacioEPepeChickpeas_3237-scaled.jpg", "keywords": [ "Meat, Seafood & Dairy", diff --git a/tests/test_data/books.ottolenghi.co.uk/ottolenghibooks_2.json b/tests/test_data/books.ottolenghi.co.uk/ottolenghibooks_2.json index 0984387d6..63acdde13 100644 --- a/tests/test_data/books.ottolenghi.co.uk/ottolenghibooks_2.json +++ b/tests/test_data/books.ottolenghi.co.uk/ottolenghibooks_2.json @@ -21,7 +21,8 @@ "200g rhubarb, cut into 3cm chunks", "200g strawberries, hulled and halved lengthways", "90g caster sugar" - ] + ], + "purpose": null }, { "ingredients": [ diff --git a/tests/test_data/cookscountry.com/cookscountry.json b/tests/test_data/cookscountry.com/cookscountry.json index 74871b6cb..34ed1b6b2 100644 --- a/tests/test_data/cookscountry.com/cookscountry.json +++ b/tests/test_data/cookscountry.com/cookscountry.json @@ -73,6 +73,7 @@ "total_time": 75, "cuisine": "Latin America & Caribbean, Mexican", "ratings": 4.2, + "ratings_count": 39, "nutrients": { "calories": "687", "fatContent": "31 grams", @@ -85,5 +86,19 @@ "sodiumContent": "987 miligrams", "cholesterolContent": "91 miligrams" }, - "image": "https://res.cloudinary.com/hksqkdlah/image/upload/ar_1:1,c_fill,dpr_2.0,f_auto,fl_lossy.progressive.strip_profile,g_faces:auto,q_auto:low,w_150/23411_sfs-beef-and-bean-burritos-012" + "dietary_restrictions": [ + "high fiber diet" + ], + "image": "https://res.cloudinary.com/hksqkdlah/image/upload/ar_1:1,c_fill,dpr_2.0,f_auto,fl_lossy.progressive.strip_profile,g_faces:auto,q_auto:low,w_150/23411_sfs-beef-and-bean-burritos-012", + "keywords": [ + "Main Courses", + "Latin America & Caribbean", + "Mexican", + "Pasta", + "Grains", + "Rice & Beans", + "Meat", + "Beans", + "Beef" + ] } diff --git a/tests/test_data/cooksillustrated.com/cooksillustrated.json b/tests/test_data/cooksillustrated.com/cooksillustrated.json index 1892e3461..582c6db67 100644 --- a/tests/test_data/cooksillustrated.com/cooksillustrated.json +++ b/tests/test_data/cooksillustrated.com/cooksillustrated.json @@ -22,6 +22,7 @@ "total_time": 10, "cuisine": "French", "ratings": 4.5, + "ratings_count": 26, "nutrients": { "calories": "207", "fatContent": "23 grams", @@ -34,5 +35,15 @@ "sodiumContent": "126 miligrams", "cholesterolContent": "61 miligrams" }, - "image": "https://res.cloudinary.com/hksqkdlah/image/upload/ar_1:1,c_fill,dpr_2.0,f_auto,fl_lossy.progressive.strip_profile,g_faces:auto,q_auto:low,w_150/SFS_Savory_Orange_Beurre_Monte%CC%81_2_awjobu" + "dietary_restrictions": [ + "low carb diet" + ], + "image": "https://res.cloudinary.com/hksqkdlah/image/upload/ar_1:1,c_fill,dpr_2.0,f_auto,fl_lossy.progressive.strip_profile,g_faces:auto,q_auto:low,w_150/SFS_Savory_Orange_Beurre_Monte%CC%81_2_awjobu", + "keywords": [ + "French", + "Fruits & Vegetables", + "Eggs & Dairy", + "Quick", + "Condiments" + ] } diff --git a/tests/test_data/dobruchut.aktuality.sk/dobruchutaktualitysk.json b/tests/test_data/dobruchut.aktuality.sk/dobruchutaktualitysk.json index 96396d98e..331e0893b 100644 --- a/tests/test_data/dobruchut.aktuality.sk/dobruchutaktualitysk.json +++ b/tests/test_data/dobruchut.aktuality.sk/dobruchutaktualitysk.json @@ -46,6 +46,9 @@ "yields": "2 servings", "description": "Rýchle knedličky z tvarohu s ešte rýchlejšou syrovo-bylinkovou omáčkou.", "total_time": 20, + "cook_time": 5, "prep_time": 15, + "ratings": 5.0, + "ratings_count": 1, "image": "https://img.aktuality.sk/foto/MHgyMzQ6MjU2MHgxNjc0L2ZpdC1pbi84ODB4NDAwL2ZpbHRlcnM6d2F0ZXJtYXJrKGh0dHA6Ly9sb2NhbGhvc3Q6ODEvaW1nL2RjaDEsLTEwLC0xMCw1MCkvaW1n/-FKw-ZNVSAbTY3mcAAS5LQ.jpg?st=9Dtr7drqJY-DJYKA1up51XKWiqAZ2hLVOvE3M5rbPyo&ts=1720619390&e=0" } diff --git a/tests/test_data/mundodereceitasbimby.com.pt/mundodereceitasbimby_1.json b/tests/test_data/mundodereceitasbimby.com.pt/mundodereceitasbimby_1.json index 7fe5bd2c7..ad349df00 100644 --- a/tests/test_data/mundodereceitasbimby.com.pt/mundodereceitasbimby_1.json +++ b/tests/test_data/mundodereceitasbimby.com.pt/mundodereceitasbimby_1.json @@ -17,23 +17,6 @@ "água, q.b.", "coentros, q.b." ], - "ingredient_groups": [ - { - "ingredients": [ - "1 polvo, médio (até 1200 g), cortado em pedaços", - "240 g cebola", - "70 g azeite", - "2 dentes de alho", - "300 g tomate, cortado em pedaços", - "sal, q.b.", - "pimenta, q.b.", - "350 g arroz agulha", - "água, q.b.", - "coentros, q.b." - ], - "purpose": null - } - ], "instructions_list": [ "Coloque no copo o polvo, 120 g de cebola, 100 g de água ou vinho tinto e programe 30 min/Varoma/\"Velocidade inversa\" /vel 1,5. Retire e reserve o polvo e a água da cozedura.", "Coloque no copo o azeite e aqueça 3 min/Varoma/vel ½", diff --git a/tests/test_data/panelinha.com.br/panelinha_1.json b/tests/test_data/panelinha.com.br/panelinha_1.json index 5f9b96b85..1ec924017 100644 --- a/tests/test_data/panelinha.com.br/panelinha_1.json +++ b/tests/test_data/panelinha.com.br/panelinha_1.json @@ -21,7 +21,7 @@ "category": "Carnes,Pratos principais", "yields": "4 servings", "description": "Clássico é clássico! Com a técnica certa, o rosbife fica perfeito. Atente para os tempos e as temperaturas. Ele não pode estar gelado e precisa mesmo do descanso depois de assado.", - "total_time": 60.0, + "total_time": 60, "cuisine": "Inglesa,Prática,Clássica,Argentina,Sem Glúten", "image": "https://i.panelinha.com.br/i1/228-q-9959-rosbife.webp" } From 19eb5fcafdea9404b9e76c79f8f589ee8e2ee788 Mon Sep 17 00:00:00 2001 From: James Addison Date: Fri, 4 Oct 2024 14:57:35 +0100 Subject: [PATCH 2/2] Bump version to 15.2.0: Adds support for: - donalskehan.com - eatthismuch.com - glutenfreeonashoestring.com - miljuschka.nl - theglutenfreeaustrian.com - theloopywhisk.com Bugfixes: - Fix ingredient grouping retrieval for arla - Remove workaround from kitchenstories - Update/fix scraper for gesund+aktiv - Update/fix scraper for realsimple - Update/fix scraper for sallysblog - Update/fix scraper for tofoo - Update/fix scraper for wikicookbook Misc: - Drops support for Python 3.8 (EOL) - Modernize some type hints given that Python 3.9 has become baseline - Adds an enforced order for nutritional expectations in JSON test data - Refactor the 'generate.py' scraper-generator script - Raise a newly-added 'RecipeSchemaNotFound' exception when the schema.org-fill plugin fails to find metadata on the page - Require only 'ingredients_list', not also 'ingredients', in the test JSON data. - Cleanups: remove redundant methods and test expectation data --- recipe_scrapers/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe_scrapers/__version__.py b/recipe_scrapers/__version__.py index 9a75d4360..30c70d39f 100644 --- a/recipe_scrapers/__version__.py +++ b/recipe_scrapers/__version__.py @@ -1 +1 @@ -__version__ = "15.1.0" +__version__ = "15.2.0"