[+] Create generator script

pull/1/head
Hykilpikonna 2021-11-12 13:49:44 -05:00
parent ff41db3b6d
commit ce1ded6576
1 changed files with 14 additions and 0 deletions

14
generator.py Normal file
View File

@ -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))