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, flavianhautbois, methane, r.david.murray, rhettinger, serhiy.storchaka
Date 2019-07-30.13:48:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Since opening this issue, I've encountered several additional instances where indentation control would have been nice. I don't agree that jq is a sufficient substitute:

1. jq is generally not pre-installed on systems. For projects where users are guaranteed to have Python installed (but may be on any operating system), it is most straightforward to be able to just use a python command and not have to explain how to install jq on 3 different OSes.

2. jq does a lot more than prettifying JSON. The simple use case of reformatting JSON (to/from a file or stdin/stdout) can be challenging.

3. json.tool describes itself as a "simple command line interface to ... pretty-print JSON objects". Indentation is an essential aspect of pretty printing. Why even have this CLI if we're unwilling to add essential basic functionality that is already well supported by the underlying json.dump API?

Python excels at APIs that match user needs. It seems like we're a small change away from making json.tool flexible enough to satisfy real-world needs.

So I'm in favor of merging PR 9765 or PR 345. I'm happy to do the work on either to get them mergeable based on whatever specification we can agree on here.
Date User Action Args
2019-07-30 13:48:29dhimmelsetrecipients: + dhimmel, rhettinger, bob.ippolito, ezio.melotti, r.david.murray, methane, serhiy.storchaka, flavianhautbois
2019-07-30 13:48:29dhimmelsetmessageid: <>
2019-07-30 13:48:29dhimmellinkissue29636 messages
2019-07-30 13:48:28dhimmelcreate