Created
March 17, 2016 07:47
-
-
Save curzona/2bd9e3f4964daa3a8132 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import json | |
from collections import OrderedDict | |
def parse_args(args=None): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('input') | |
parser.add_argument('output') | |
args = parser.parse_args(args) | |
return args | |
def main(args=None): | |
args = parse_args(args) | |
text = open(args.input).read() | |
data = json.loads(text, object_pairs_hook=OrderedDict) | |
text = json.dumps(data, indent=4) | |
open(args.output, 'wb').write(text) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment