25 lines
525 B
Python
25 lines
525 B
Python
import argparse
|
|
import gzip
|
|
import json
|
|
|
|
|
|
def parse_args():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("compressed_json_path", help="Path to compressed JSON file")
|
|
return parser.parse_args()
|
|
|
|
|
|
def main(fp):
|
|
with open(fp, "rb") as f:
|
|
compressed_json_path = f.read()
|
|
|
|
json_str = gzip.decompress(compressed_json_path)
|
|
json_dict = json.loads(json_str)
|
|
|
|
print(json.dumps(json_dict, indent=2))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
args = parse_args()
|
|
main(args.compressed_json_path)
|