搜索

PythonReactSEOPDF
OpenClaw

json-toolkit

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

claudiodrusus0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install claudiodrusus/skill-3

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

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:

python main.py data.json

Validate without output:

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

Query a nested value:

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

Minify for production:

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

Sort keys for consistent diffs:

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

Pipe from curl:

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

来源信息

Source
github
Repository
openclaw/skills
Path
skills/claudiodrusus/skill-3
Version
—
Commit
a953170a6753823c4b36fd3a06b2e22488f6a82e
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

来源内容

SKILL.md
# 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

相关技能

OpenClaw

geo-optimization

capt-marbles

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...

OpenClaw

139mail

chang-tong

139邮箱邮件收发 Skill - 支持 IMAP/SMTP 协议,兼容139/QQ/163/Gmail等主流邮箱 功能: 1. 发送邮件(SMTP) 2. 接收邮件(IMAP) 3. 查看收件箱列表 4. 查看未读邮件 当用户提到 "发邮件"、"收邮件"、"查看邮件"、"邮箱"...