actually clean json again

This commit is contained in:
neingeist 2025-06-12 23:21:45 +02:00
parent d6dc77aa8e
commit c04c821432
20 changed files with 325 additions and 319 deletions

View file

@ -16,6 +16,12 @@ def clean_recipe(recipe):
for ingredient in step["ingredients"]:
ingredient["food"].pop("properties", None)
# sort conversions
recipe.pop("food_properties", None)
for step in recipe["steps"]:
for ingredient in step["ingredients"]:
ingredient["conversions"] = sorted(ingredient["conversions"], key=lambda c: c["unit"])
return recipe