Message289714
@serhiy.storchaka I totally understand the desire to keep json.tool simple. However, given the description of json.tool in the documentation (below), I think an indentation option is within scope:
> The json.tool module provides a simple command line interface to validate and pretty-print JSON objects.
Indentation/newlines are a fundamental aspect of "pretty-printing". Right now I rarely use json.tool, since indent=4 is too extreme from a visual and file size perspective. Instead I prefer `indent=2` (or even `indent=1`) and I now have to:
1. create a python script to set my desired input
2. make sure every environment has access to this python script (the real annoyance)
Currently, json.tool has a --sort-keys argument, which I think is great. --sort-keys is also an essential feature from my perspective (bpo-21650). So in short, I think json.tool is close to being a really useful utility but falls a bit short without an indentation option.
Given that json.tool exists, I think it makes sense to take steps to make sure it's actually relevant as a json reformatter. Given this motivation, I'm not opposed to adding --compact, if we're confident it will be forward compatible with the json.dump API. |
|
Date |
User |
Action |
Args |
2017-03-16 14:00:32 | dhimmel | set | recipients:
+ dhimmel, rhettinger, bob.ippolito, ezio.melotti, r.david.murray, methane, serhiy.storchaka |
2017-03-16 14:00:32 | dhimmel | set | messageid: <1489672832.64.0.86041502355.issue29636@psf.upfronthosting.co.za> |
2017-03-16 14:00:32 | dhimmel | link | issue29636 messages |
2017-03-16 14:00:32 | dhimmel | create | |
|