From dd9f2ebf37c0527f679b41aa8bbb809d053e2b5d Mon Sep 17 00:00:00 2001 From: none Date: Wed, 24 Jan 2024 16:34:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BA=D0=BE=D0=B4=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update_db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/update_db.py b/update_db.py index b21691b..2e96705 100644 --- a/update_db.py +++ b/update_db.py @@ -96,4 +96,6 @@ for item in yaml.load(requests.get(RECIPES_URL).content.decode("utf-8"), Loader= reagents = [Reagent(init_data=content[item]) for item in content if "reactants" in content[item]] -write_db({x.name: x.dict() for x in reagents}) +db = {x.name: x.dict() for x in reagents} +with open("db.json", mode="w", encoding="utf-8") as db_file: + json.dump(db, db_file, ensure_ascii=False, indent=2)