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

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

prettyjson-1.0.3.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

prettyjson-1.0.3-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

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