✓ Verified 📁 File Management ✓ Enhanced Data

Skill 3

Swiss-army knife for JSON files.

Rating
4.5 (420 reviews)
Downloads
18,320 downloads
Version
1.0.0

Overview

Swiss-army knife for JSON files.

Key Features

1

Pretty-print with configurable indentation (2, 4, or any number of spaces)

2

Minify JSON to reduce file size for APIs and storage

3

Validate JSON and get structural stats (type, key count, size)

4

Query nested data with dot-notation paths including array indices

5

Sort keys alphabetically for deterministic output and easier diffs

6

Stdin support for use in shell pipelines with other tools

Complete Documentation

View Source →

JSON Toolkit

A zero-dependency Python utility for working with JSON data. Validates, formats, minifies, queries, and inspects JSON files — all with Python's standard library.

Features

  • Pretty-print with configurable indentation (2, 4, or any number of spaces)
  • Minify JSON to reduce file size for APIs and storage
  • Validate JSON and get structural stats (type, key count, size)
  • Query nested data with dot-notation paths including array indices
  • Sort keys alphabetically for deterministic output and easier diffs
  • Stdin support for use in shell pipelines with other tools

Usage Examples

Pretty-print a JSON file:

bash
python main.py data.json

Validate without output:

bash
python main.py config.json --validate
# ✓ Valid JSON
#   Type: object (12 keys)
#   Size: 4832 bytes

Query a nested value:

bash
python main.py users.json --query data.users.0.name
# "Alice"

Minify for production:

bash
python main.py config.json --minify -o config.min.json

Sort keys for consistent diffs:

bash
python main.py package.json --sort-keys -o package-sorted.json

Pipe from curl:

bash
curl -s https://api.example.com/data | python main.py - --query results.0

Query Syntax

Use dot notation to navigate nested structures. Array indices are numbers:

  • name — top-level key
  • data.users — nested object key
  • data.users.0 — first element of an array
  • data.users.0.email — field of the first array element
  • config.servers.2.host — deeply nested value

Command Line Options

  • input — JSON file path, or - for stdin
  • -o, --output — Output file (defaults to stdout)
  • --indent N — Indentation spaces (default: 2)
  • --minify — Output minified JSON (no whitespace)
  • --query PATH / -q PATH — Extract a value at the given dot-notation path
  • --validate — Only validate and print stats, no output
  • --sort-keys — Sort object keys alphabetically
  • --json — (implicit) Output is always valid JSON

Installation

Terminal bash

openclaw install skill-3
    
Copied!

💻Code Examples

Validate without output:

validate-without-output.sh
python main.py config.json --validate
# ✓ Valid JSON
#   Type: object (12 keys)
#   Size: 4832 bytes

Query a nested value:

query-a-nested-value.sh
python main.py users.json --query data.users.0.name
# "Alice"

Tags

#pdf_and-documents #json

Quick Info

Category File Management
Model Claude 3.5
Complexity One-Click
Author claudiodrusus
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install skill-3