✨ actually clean json again
This commit is contained in:
parent
d2bba29482
commit
d6dc77aa8e
1 changed files with 7 additions and 2 deletions
|
@ -8,8 +8,13 @@ from config import *
|
||||||
def clean_recipe(recipe):
|
def clean_recipe(recipe):
|
||||||
# remove useless ever-changing fields
|
# remove useless ever-changing fields
|
||||||
for keyword in recipe["keywords"]:
|
for keyword in recipe["keywords"]:
|
||||||
if "updated_at" in keyword:
|
keyword.pop("updated_at", None)
|
||||||
del keyword["updated_at"]
|
|
||||||
|
# remove buggy food properties
|
||||||
|
recipe.pop("food_properties", None)
|
||||||
|
for step in recipe["steps"]:
|
||||||
|
for ingredient in step["ingredients"]:
|
||||||
|
ingredient["food"].pop("properties", None)
|
||||||
|
|
||||||
return recipe
|
return recipe
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue