From 70aac51c22a8e23622ab86ed23cd90b647bcab7b Mon Sep 17 00:00:00 2001 From: Raoul Collenteur Date: Wed, 25 Sep 2024 20:16:59 +0200 Subject: [PATCH] script to use to add a field --- scripts/rename_field.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 scripts/rename_field.py diff --git a/scripts/rename_field.py b/scripts/rename_field.py new file mode 100644 index 0000000..9a34d0e --- /dev/null +++ b/scripts/rename_field.py @@ -0,0 +1,16 @@ +import json + + +def add_entry(file_path): + with open(file_path, "r") as file: + data = json.load(file) + + for package in data.values(): + package["legacy"] = "" + + with open(file_path, "w") as file: + json.dump(data, file, indent=4) + + +if __name__ == "__main__": + add_entry("list.json")