Option to allow pretty print without alpha sorting
See original GitHub issueRight now, the options are colors
, format
, and all
, but often the order of the json returned is intentional and for clarify. It would be nice to be able to pretty print the json without having it’s keys sorted 😃
Awesome tool, and thanks very much for everything!
Issue Analytics
- State:
- Created 11 years ago
- Reactions:14
- Comments:36 (10 by maintainers)
Top Results From Across the Web
Option to allow pretty print without alpha sorting #128 - GitHub
It would be nice to be able to pretty print the json without having it's keys sorted :) Awesome tool, and thanks very...
Read more >prevent beeprint or prettyprint from ordering dict keys in ...
Finally figured out how to work this out : by setting PrettyPrinter parameter "sort_dicts" to False keys are ordered according to input ...
Read more >Prettify Your Data Structures With Pretty Print in Python
sorts the keys alphabetically. It keeps the output for dictionaries consistent, readable, and—well—pretty! When pprint() was first implemented, dictionaries ...
Read more >pprint — Data pretty printer — Python 3.11.1 documentation
Construct PrettyPrinter objects explicitly if you need to adjust the width constraint. Dictionaries are sorted by key before the display is computed. Changed...
Read more >tidy - check, correct, and pretty-print HTML(5) files
--output-xml Boolean (no if unset) This option specifies if Tidy should pretty print output, writing it as well-formed XML. Any entities not defined...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just released v2.2.0 that addresses this issue. Learn about about the new
--unsorted
,--sorted
and--format-options
here:https://httpie.org/docs#colors-and-formatting
This feature should be default. I love HTTPie, but resorting the keys - while convenient for some usage - is confusing if you don’t realize, that client tool does this. Piping
http
tojq -C
is a workaround, but it should be default behavior. While the order is not probably that important for a machine, it may be for a human observer.