Pridan skript na jednoznacnejsi razeni jsonu.
This commit is contained in:
parent
f820b580ce
commit
936ddd980e
1 changed files with 12 additions and 0 deletions
12
fix_json.py
Executable file
12
fix_json.py
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import json
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("input", type=argparse.FileType('r', encoding='utf-8'))
|
||||
parser.add_argument('output', type=argparse.FileType('w', encoding='utf-8'))
|
||||
args = parser.parse_args()
|
||||
|
||||
data = json.load(args.input)
|
||||
json.dump(data, args.output, ensure_ascii=False, sort_keys=True, indent='\t')
|
Loading…
Reference in a new issue