diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-01-05 00:53:49 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-01-05 00:53:49 (GMT) |
commit | 007a6a839e3ee6b2e21b740ae5ea694ddbc0d405 (patch) | |
tree | d548b6848ebe5474ff19cf8ffaed807210bd07d9 /tools/json-normalize | |
parent | 82f7ae46a8d39c336b0504f45274bda3c6b93bbd (diff) |
More appropriate naming
Diffstat (limited to 'tools/json-normalize')
-rwxr-xr-x | tools/json-normalize | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/tools/json-normalize b/tools/json-normalize deleted file mode 100755 index 069908d..0000000 --- a/tools/json-normalize +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/python - -import argparse -import json -from operator import itemgetter - -parser = argparse.ArgumentParser() -parser.add_argument("paths", nargs="+", help="path to the json file") -parser.add_argument("--sort-by", help="dictionary key to sort by") -args = parser.parse_args() - -for path in args.paths: - in_file = open(path, "rb") - data = json.load(in_file) - in_file.close() - - if args.sort_by is not None: - data.sort(key=itemgetter(args.sort_by)) - - out_file = open(path, "wb") - json.dump(data, out_file, sort_keys=True, indent=4) - out_file.write('\n') - out_file.close() |