Skip to content

Instantly share code, notes, and snippets.

@akccakcctw
Last active January 4, 2019 06:22
Show Gist options
  • Save akccakcctw/e0e2ebe6d6bfba0dc4f52ceae53a5e03 to your computer and use it in GitHub Desktop.
Save akccakcctw/e0e2ebe6d6bfba0dc4f52ceae53a5e03 to your computer and use it in GitHub Desktop.
JSON prettifier with python
#!/usr/bin/env python3
# coding=utf-8
"""
usage example: `./json_prettifier.py input.json > output.json`
"""
import sys
import json
with open(sys.argv[1], "r") as f:
parsed = json.load(f)
print(json.dumps(parsed, indent=4, ensure_ascii=False))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment