A json pretty printer for python
Project description
pprintjson
A json pretty printer for Python 🐍.
Installation
$ pip install pprintjson
Usage
usage: pprintjson.py [-h] [-i num] [-o file] [-s cmd] [-v] [file]
A pretty-printing function for json.
positional arguments:
file file to json pretty-print
optional arguments:
-h, --help show this help message and exit
-i num, --indent num indent <num> number of spaces at each level (default: 4)
-o file, --output file write output to <file> instead of stdout (default: stdout)
-s cmd, --string cmd string to json pretty-print
-v, --version show program's version number and exit
# 1. import the "pprintjson" function.
from pprintjson import pprintjson as ppjson
# 2. pretty print JSON.
obj = { "a": 1, "b": "string", "c": True }
ppjson(obj)
License
MIT © Travis Clarke
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pprintjson-1.1.0.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for pprintjson-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a318d8b81fcdf892229703f322937529fa39432ebef4cde7082a1250c78295f |
|
MD5 | e747da4324ac61d0d9ad4cc864dad4c8 |
|
BLAKE2b-256 | ade2f68fb501ce1040b1043d1a1fb7299b178366530dbb3800e51f81909e9e0d |