A TUI application to visually inspect and navigate JSON and JSONL data
Project description
jsonltui
jsonltui is a fast TUI application (with optional slow webui) to visually navigate and inspect JSON and JSONL data. Easily localize parse errors in large JSONL files. Made with LLM fine-tuning workflows in mind.
With JSONL error handling:
With modal view for large strings:
Installation
pip install jsonltui
Features
- Interactive tree view of JSON and JSONL data in both TUI and Web UI
- Supports both single JSON objects and JSONL (multiple JSON objects, one per line)
- Graceful handling of parsing errors, displaying them inline with successfully parsed data
- Expandable error nodes showing original unparsable text and error messages
- Truncation of long text values with the ability to view full text in a modal
- Keyboard navigation for easy exploration of the JSON structure in TUI mode
- Web-based interface for a more familiar and accessible visualization
Usage
You can use jsonltui in three ways:
-
With a JSON or JSONL file using the TUI:
jsonltui path/to/your/file.json -
With piped input using the TUI:
cat path/to/your/file.json | jsonltui -
With the Web UI option:
jsonltui --webui path/to/your/file.jsonor
cat path/to/your/file.json | jsonltui --webui
TUI Keyboard Controls
- Arrow keys: Navigate the tree
- Enter: Expand/collapse nodes or view full text of truncated values
- 'q' or Ctrl+C: Quit the application
- 'b' or Escape: Go back from full text view to main tree view
Web UI
The Web UI provides a familiar interface with collapsible tree nodes and expandable long text values. It opens in your default web browser, allowing for easy navigation and exploration of your JSON/JSONL data.
Error Handling
When jsonltui encounters a parsing error in a JSONL file, it will:
- Display the error in red at the appropriate position in the tree.
- Show the line number where the error occurred.
- Allow you to expand the error node to see:
- The original unparsable text
- The specific error message
This allows you to inspect and debug issues in your JSON data easily.
Installation (development)
-
Ensure you have Python 3.7 or higher installed on your system.
-
Clone this repository:
git clone https://github.com/gr-b/jsonltui.git cd jsonltui -
Install locally
pip install -e .
Limitations
- The application loads the entire JSON/JSONL file into memory, so it may not be suitable for extremely large files.
- Syntax highlighting is not provided for the JSON structure in the TUI to maintain simplicity and performance.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
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 jsonltui-0.1.0.tar.gz.
File metadata
- Download URL: jsonltui-0.1.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ff1473222fb87c38ba7eff3e29eb523e5c10cb050eeed3d8a683ba6f7728270
|
|
| MD5 |
5b1800a6a81d9b505c9fbfed23f29525
|
|
| BLAKE2b-256 |
da6a3cd5b1f1a8bd6175d11756395f2e54e01dbc08aca72dd359db8ae66d469e
|
File details
Details for the file jsonltui-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jsonltui-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce2aa4753c10edcdf7eeacf8249eacb1a392015c129d47714b4b48f5e06009a7
|
|
| MD5 |
acbf2941b76a6db8578a336f0ca6b409
|
|
| BLAKE2b-256 |
73302d20dec4c08b0077913a8c91c5fcd98b88eb5f2b5d4cad64608de9095b2a
|