[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Brad, thank you for the suggestion, but our goals for this tool are somewhat limited, so I'm going to close this as being out of scope for the intended purpose of json.tool. If some other core developer wants to champion this, feel free to re-open. -

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Brad Solomon
Brad Solomon added the comment: > json.tool produces more readable representation. Your option is opposite to > this purpose. That is correct, though I'm not sure what point you're trying to make. The purpose of minifying isn't to make the input more readable; it's to condense it in the in

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: json.tool produces more readable representation. Your option is opposite to this purpose. -- nosy: +serhiy.storchaka ___ Python tracker __

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Brad Solomon
Brad Solomon added the comment: Since, as you point out, json.tool is made for convenience, I see the reverse of pretty-printing (minifying) being just as convenient: $ cat > expanded.json < { > "foo": "bar", > "json": "obj" > } > EOF $ ./python.exe -m json.tool --minify expanded.json

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: -0 ISTM that minifying isn't something one usually does with a command-line tool. Instead, it is part of the program generating JSON in the first place. IOW, minification is useful in the standard library but not a part of json.tool which normally used

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Brad Solomon
Change by Brad Solomon : -- keywords: +patch pull_requests: +15277 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15601 ___ Python tracker ___ ___

[issue37982] Add a --minify argument to json.tool

2019-08-29 Thread Brad Solomon
New submission from Brad Solomon : I propose adding a command line `--minify` flag to the json/tool.py module. This flag, if specified, uses `indent=None` and `separators=(',', ':')` to eliminate indent and separator whitespace in the output. Minifying JSON (as is also done frequently with J