A CLI tool for viewing and manipulating JSON files
Project description
jspprint
A CLI tool for viewing and manipulating JSON files. Pretty-prints JSON with syntax highlighting by default, supports filtering by keys, and allows in-memory modifications for easy piping — without altering the original file.
Features
- Pretty-print JSON with syntax highlighting (default behavior)
- Filter by key(s) to extract and display specific parts of a JSON structure
- In-memory modifications — add, update, replace, or delete values in the output without touching the source file
- Merge from file or stdin — set a key's value to the contents of another JSON file, or pipe JSON in via stdin
- Stdin as input — read JSON from stdin instead of a file (
cat data.json | jspprint) - Pipe-friendly — output can be piped to other commands or redirected to files
Planned
- CSV, XML, and YAML support
Tech Stack
- Python
- Rich for colored/syntax-highlighted output
- Typer for argument parsing
Installation
pip install jspprint
# or
pipx install jspprint
Usage
# Pretty-print a JSON file with syntax highlighting
jspprint data.json
# Read JSON from stdin
cat data.json | jspprint
# Filter by key
jspprint data.json name
# Filter by nested key path
jspprint data.json users.0.email
# Modify a value in the output (file is not changed)
jspprint data.json --set name=updated
# Delete a key from the output
jspprint data.json --del obsoleteField
# Set a key's value from another JSON file
jspprint data.json --set config=@overrides.json
# Same thing via stdin pipe
cat overrides.json | jspprint data.json --set config=@-
# Output compact JSON (single line, no highlighting)
jspprint data.json --compact
jspprint data.json -c
# Pipe the result
jspprint data.json --set env=prod -c | kubectl apply -f -
License
MIT
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
jspprint-0.1.1.tar.gz
(5.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jspprint-0.1.1.tar.gz.
File metadata
- Download URL: jspprint-0.1.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e13e8216de18806655b7a1841d0c169d7f745714602aaf53c37916403d157ec
|
|
| MD5 |
057ebeead1154d2cf74a436048d9ba99
|
|
| BLAKE2b-256 |
88631ea19463377036bdc318446fc412ded29403bccb5691f9dd77bb142f9afb
|
File details
Details for the file jspprint-0.1.1-py3-none-any.whl.
File metadata
- Download URL: jspprint-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f629da1420a3955c980fff9a22b51808b543c030c9a9be22ff2d305b0a962a0c
|
|
| MD5 |
a897381ab7be68703119d2c9876d5876
|
|
| BLAKE2b-256 |
f1ca1db55793bdb2a9129e25fe6730c8d7d9ed78643d6462c00ac7ac009f7038
|