Skip to content

Console utility for pretty JSON output

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt
Notifications You must be signed in to change notification settings

Miku-chan/printjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Utility for pretty JSON output

Simple python utility for using in shell scripts.

Features

  • Print colorized JSON
  • Minimized and formatted output
  • Output elements by keys and indexes
  • Check JSON for correctness
  • Automatically disabling color sequences, when prints to pipeline, file or other non-tty output

Examples

  • test.json
{
  "arr": [
    123,
    "λάμβδα ラムダ lambda",
    [
      "1",
      "2"
    ]
  ],
  "test": "test"
}
  • Colorized indented
printjson test.json
  • Minimized monochrome
printjson -om test.json

Result:

{"test":"test","arr":[123,"λάμβδα ラムダ lambda",["1","2"]]}
  • Print third entry of "arr" array, using "__" as delimiter
printjson -k 'arr__2' -d '__' test.json

Result:

[
  "1",
  "2"
]

About

Console utility for pretty JSON output

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages