Skip to content
Back to skills

Json Toolkit

BSecurity

Swiss-army knife for JSON files. Pretty-print, validate, minify, sort keys, and query with dot-notation paths. Zero dependencies.

  • 33 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 30, 2026
toolspythonshellbashapi

Works with

  • api

Security analysis

B84/100
  • mediumUses curl or wget to download content
  • criticalDownloads and executes remote scripts — classic supply chain attack

Pro scans all 2 files and shows the line behind each finding

Scanned May 30, 2026

npx -y skills add dvcrn/openclaw-skills-marketplace --skill json-toolkit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Json Toolkit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Json Toolkit
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/dvcrn-json-toolkit/badge)](https://www.skillsdirectory.com/skills/dvcrn-json-toolkit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: json-toolkit
description: "Swiss-army knife for JSON files. Pretty-print, validate, minify, sort keys, and query with dot-notation paths. Zero dependencies."
---

# 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

Files in this skill

  • SKILL.md2.1 KB
  • main.py3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…