Skip to main content

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: jsonltui tree view

With modal view for large strings: jsonltui modal screen

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:

  1. With a JSON or JSONL file using the TUI:

    jsonltui path/to/your/file.json
    
  2. With piped input using the TUI:

    cat path/to/your/file.json | jsonltui
    
  3. With the Web UI option:

    jsonltui --webui path/to/your/file.json
    

    or

    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:

  1. Display the error in red at the appropriate position in the tree.
  2. Show the line number where the error occurred.
  3. 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)

  1. Ensure you have Python 3.7 or higher installed on your system.

  2. Clone this repository:

    git clone https://github.com/gr-b/jsonltui.git
    cd jsonltui
    
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonltui-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsonltui-0.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

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

Hashes for jsonltui-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6ff1473222fb87c38ba7eff3e29eb523e5c10cb050eeed3d8a683ba6f7728270
MD5 5b1800a6a81d9b505c9fbfed23f29525
BLAKE2b-256 da6a3cd5b1f1a8bd6175d11756395f2e54e01dbc08aca72dd359db8ae66d469e

See more details on using hashes here.

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

Hashes for jsonltui-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce2aa4753c10edcdf7eeacf8249eacb1a392015c129d47714b4b48f5e06009a7
MD5 acbf2941b76a6db8578a336f0ca6b409
BLAKE2b-256 73302d20dec4c08b0077913a8c91c5fcd98b88eb5f2b5d4cad64608de9095b2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page