lib: read_recipes()

This commit is contained in:
neingeist 2026-04-12 23:51:21 +02:00
parent d54fd73e53
commit 6c7ad52c72
4 changed files with 7 additions and 30 deletions

View file

@ -77,19 +77,7 @@ def main():
Path("fruehstueck.csv").unlink(missing_ok=True)
recipes = []
for json_file in os.listdir(OUTDIR_JSON):
with open(os.path.join(OUTDIR_JSON, json_file), "r", encoding="utf-8") as f:
data = json.load(f)
recipes.append(data)
recipes.sort(key=lambda r: r["name"])
# filter "Frühstück"
recipes = [
r
for r in recipes
if any(k["name"] == "Fr\u00fchst\u00fcck" for k in r["keywords"])
]
recipes = read_recipes(keyword="Frühstück")
with open("fruehstueck.csv", "w", newline="") as f:
fwriter = csv.writer(