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.

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 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page