diff options
| author | Mistivia <i@mistivia.com> | 2025-01-15 19:12:12 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-01-15 19:12:46 +0800 |
| commit | 4da382953c830a61ae24ccbe95c4241db8788269 (patch) | |
| tree | 31f6d184273274e2660516d1ac1146b5661f20b6 /scripts/card_process.py | |
restore
Diffstat (limited to 'scripts/card_process.py')
| -rw-r--r-- | scripts/card_process.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/card_process.py b/scripts/card_process.py new file mode 100644 index 0000000..35373d0 --- /dev/null +++ b/scripts/card_process.py @@ -0,0 +1,15 @@ +import json + +j = json.load(open("./mtg.json")) +for setname in j['data'].keys(): + cardset = j['data'][setname] + for card in cardset['cards']: + if 'foreignData' in card.keys(): + for fd in card['foreignData']: + if fd['language'] == 'Chinese Simplified': + print(card['name']) + print(fd['name']) + if 'text' in fd.keys(): + print(fd['text'].replace('\n', '\x01')) + else: + print() |
