This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dhimmel
Recipients bob.ippolito, dhimmel, ezio.melotti, methane, r.david.murray, rhettinger, serhiy.storchaka
Date 2017-03-16.14:00:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
@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:32dhimmelsetrecipients: + dhimmel, rhettinger, bob.ippolito, ezio.melotti, r.david.murray, methane, serhiy.storchaka
2017-03-16 14:00:32dhimmelsetmessageid: <>
2017-03-16 14:00:32dhimmellinkissue29636 messages
2017-03-16 14:00:32dhimmelcreate