Last active
June 23, 2016 10:44
-
-
Save narate/f2c5cc73ecc9d4bdd2f7368fe42cef39 to your computer and use it in GitHub Desktop.
Just prettify url query string
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 | |
from urlparse import urlparse, parse_qs | |
import json | |
import sys | |
data = sys.stdin.read() | |
o = urlparse(data) | |
qs = parse_qs(o.query, keep_blank_values=True) | |
print json.dumps(qs, sort_keys=True, indent=4, ensure_ascii=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example