Skip to main content

Console utility for pretty JSON output

Project description

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"
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

printjson-1.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

printjson-1.0.1-py2.py3-none-any.whl (5.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file printjson-1.0.1.tar.gz.

File metadata

  • Download URL: printjson-1.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for printjson-1.0.1.tar.gz
Algorithm Hash digest
SHA256 06a74d48ca2c6e9d34bea6a08f3d34684a2259a9b516541e9de66d0501430f33
MD5 eca9c4e5e328425194220a3085a355fd
BLAKE2b-256 6cf3f9e97b8f83bee286653a9c053ab12bbcc9ab5bc6c5c91dac8b06fdfa7da7

See more details on using hashes here.

File details

Details for the file printjson-1.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for printjson-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 483ec050c993f42bfdc60482e84e9fb6a2456caf162c329816a8fa862705ccd0
MD5 114504a9d13d0f7f4d7e0650276ec67d
BLAKE2b-256 b24aaf6b0b575c69fd6a5ae834a698b0a8285a28a2a15afe66762dbdb6a04512

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page