jml is a lightweight, fast, and efficient JSON ↔ YAML converter CLI. It allows you to convert, validate, and pretty-print files. Perfect for developers, CI/CD pipelines, and quick command-line conversions.
- Convert between JSON and YAML
- Pretty-print JSON (human-readable format)
- Subcommand:
validateto check file validity - stdin/stdout support – can read from pipes
- Write output to file using
-o/--output - Fully flag-based CLI, order of flags is flexible
# Local development installation
pip install -e .
# From PyPI (once published)
pip install jml# YAML → JSON (single-line)
jml -j -i config.yaml
# JSON → YAML
jml -y --input data.json
# JSON → Pretty JSON
jml -jpi config.yaml
# Write output to a file
jml -y -i data.json -o data.yml# Using pipe
cat a.json | jml -y
# Using redirect
jml -j < config.yaml > config.jsonjml validate config.yaml
# output: ✓ config.yaml is valid| Flag | Description |
|---|---|
-j, --json |
Output JSON |
-y, --yaml |
Output YAML |
-p, --pretty |
Pretty JSON output (only for JSON) |
-o, --output PATH |
Output file |
-i, --input PATH |
Input file (optional, can use stdin) |