Skip to main content

Command-line tool to validate and pretty-print JSON(just for the missing options in `json.tool`)

Project description

Pretty JSON

Tool for printing pretty JSON (just for the missing options in json.tool)

For the issues in Python bug tracker:

Installing

Install and update using pip:

    pip install -U prettyjson

Usage Examples

Example 1

echo '{"name": "vimfun", "from": "The Earth"}' | python -m prettyjson

Result:

{
    "name": "vimfun",
    "from": "The Earth",

}

Example 2

echo '{"name": "vimfun", "from": "The Earth"}' | python -m prettyjson --indent=2

Result:

{
  "name": "vimfun",
  "from": "The Earth"
}

Example 3

echo '{"name": "王旭林", "from": "The Earth"}' | python -m prettyjson --indent=2 --no-ensure-ascii

Result:

{
  "name": "王旭林",
  "from": "The Earth"
}

Links

Download files

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

Files for prettyjson, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size prettyjson-1.0.3-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size prettyjson-1.0.3.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page