From ce1ded6576374be0f0157cbe7a758e9825ca99c4 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Fri, 12 Nov 2021 13:49:44 -0500 Subject: [PATCH] [+] Create generator script --- generator.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 generator.py diff --git a/generator.py b/generator.py new file mode 100644 index 00000000..51c1df19 --- /dev/null +++ b/generator.py @@ -0,0 +1,14 @@ +import io +import os, json5 + +if __name__ == '__main__': + output = [] + for p in os.listdir("people/"): + info_path = f'people/{p}/info.json5' + if os.path.isfile(info_path): + with io.open(info_path, 'r', encoding='utf-8') as f: + o = json5.load(f) + output.append({'path': p, 'id': o['id'], 'name': o['name'], 'profileUrl': o['profileUrl']}) + + with io.open('generated/people-list.json5', 'w', encoding='utf-8') as f: + f.write(json5.dumps(output, indent=2, ensure_ascii=False))