shyaml: YAML for the Command Line (Python version)

0.6.2 · maintenance · verified Sat Apr 11

The original `shyaml` Python library (v0.6.2) is a command-line tool designed for reading and querying YAML files. It enables shell scripts to easily access YAML data using simple dot-notation paths. While it remains available on PyPI, this Python version is in a low-maintenance state with no new features planned. Active development has transitioned to `shyaml-rs`, a Rust rewrite that offers significant performance improvements and additional features like write capabilities, while maintaining command-line interface compatibility.

Warnings

Install

Imports

Quickstart

The primary use of `shyaml` is via the command line to extract values from YAML. It reads YAML from standard input and outputs the requested value to standard output. Paths are specified using dot notation.

cat <<EOF > config.yaml
database:
  host: localhost
  port: 5432
  credentials:
    username: admin
    password: ${DB_PASSWORD:-fallback_pass}
EOF

DB_PASSWORD="secure_pass" \
  cat config.yaml | shyaml get-value database.credentials.password

view raw JSON →