A simple JSON and python dictionary pretty printer
Project description
jprint
A simple tool for pretty priting json strings and python dictionaries to the console.
Python Dictionary Example
from jprint import jprint
example_dict = {
"name": "John Doe",
"age": 30,
"city": "New York",
"hobbies": ["reading", "traveling", "photography"]
}
jprint(example_dict)
JSON String Example
from jprint import jprint
json_string = '''
{
"name": "Alice",
"age": 32,
"email": "alice@example.com",
"address": {
"street": "123 Main St",
"city": "Los Angeles",
"state": "CA",
"zip": "90012"
},
"phone_numbers": [
{
"type": "home",
"number": "555-1234"
},
{
"type": "work",
"number": "555-5678"
}
]
}
'''
jprint(json_string, indent=2)
Under The Covers
jprint makes use of the pygmyents library for colored output and json.dumps() for other formatting. You can pass jprint any of the parameters that you would pass to json.dumps
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
jprint-1.6.tar.gz
(2.1 kB
view details)
Built Distribution
jprint-1.6-py3-none-any.whl
(2.4 kB
view details)
File details
Details for the file jprint-1.6.tar.gz
.
File metadata
- Download URL: jprint-1.6.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.2 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e9ac45de56819013452240efb57f4f0a602f9ce89a3363d60c63edb501887cb |
|
MD5 | e79f1d0fc3a2ba8919547905120b0a28 |
|
BLAKE2b-256 | c359b877f8f8ed6437ec7992a3187fb0dd449a71e1aafefcbe9bad8dd458ea27 |
File details
Details for the file jprint-1.6-py3-none-any.whl
.
File metadata
- Download URL: jprint-1.6-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.2 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e309157f25510430b6884c0930f48023c43b6ab2d3f56399ebab738c62fc3133 |
|
MD5 | 0bbd56c674c40f5431e2b432a2ea27d9 |
|
BLAKE2b-256 | c969205a6efe167ea014635b2c1162ddd73cd691d921701563ff9541d1fdf75f |