yamlpath
Command-line get/set/merge/validate/scan/convert/diff processors for YAML/JSON/Compatible data using powerful, intuitive, command-line friendly syntax
What it is and what it does
yamlpath is a query language and Python library for selecting, extracting, and modifying nodes within YAML, JSON, and EYAML documents. It supports both dot-notation (inspired by Hiera) and forward-slash notation (influenced by XPath), allowing you to identify single nodes or search for multiple nodes matching criteria like key names, values, anchors, or regex patterns. The package includes command-line tools for common operations—get, set, merge, validate, diff, and scan—making it useful both as a standalone CLI utility and as a library embedded in other Python projects.
The library is built on ruamel.yaml and python-dateutil, keeping its dependency footprint small. It handles complex YAML structures including arrays, hashes, anchors, aliases, and encrypted EYAML fields. You can use it to programmatically navigate nested data, perform bulk updates across multiple matching paths, merge configuration files, or validate document structure from the command line without writing custom parsing code.
Use it for:
- Extract or update specific values in Kubernetes manifests or Helm charts using path queries from shell scripts.
- Merge multiple YAML configuration files while preserving structure and handling conflicts.
- Search for and decrypt EYAML-encrypted values across configuration documents in a CI/CD pipeline.
- Validate YAML/JSON document structure and content against expected schemas or patterns.
- Diff two YAML files to identify configuration changes between versions.
- Programmatically modify nested YAML data in Python without manual dict traversal.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Query, retrieve, update, merge, validate, and diff YAML, JSON, and EYAML documents using a path-based syntax that works from the command line or as a Python library.
Yes. The package is production-stable, actively maintained, has no known vulnerabilities, low install friction, and a permissive license. It fills a genuine gap for path-based YAML querying and editing. Install it if you need command-line YAML/JSON manipulation, configuration file merging, or programmatic access to nested data structures.
Install
yamlpath on PyPI
pip
pip install yamlpathuv
uv add yamlpathpoetry
poetry add yamlpathInstalling yamlpath
Before you install
Low friction install with only two runtime dependencies (ruamel.yaml and python-dateutil). The package is actively maintained with a recent release and supports current Python versions (3.10 through 3.14).
License in practice
ISC license is permissive and allows commercial use, modification, and distribution with minimal restrictions—suitable for most projects without legal concerns.
Quickstart
pip install yamlpath
from yamlpath import Processor
from ruamel.yaml import YAML
yaml = YAML()
data = yaml.load(open('file.yaml'))
processor = Processor(data)
for node in processor.get_nodes('path.to.key'):
print(node.value)
Requires Python 3.10 or later; EYAML support is optional and requires separate installation for encrypted data handling.
Verify before relying
- Whether the library handles circular references or deeply nested structures without performance degradation.
- Exact performance characteristics when querying or merging large YAML documents.
- Whether regex search expressions support all Python regex features or have limitations.
Package facts
| License | ISC (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — ruamel.yaml, python-dateutil |
| Maintenance | actively maintained — 104 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 148,791/month — #11,018 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: yamlpath-3.9.1-py3-none-any.whl
Keywords: yaml, eyaml, json, yaml-path, diff, merge
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
HyperPyYAMLExtends YAML syntax with Python-friendly…
permissive · top 5,000 on PyPI
yamaleYamale validates YAML files against a schema…
permissive · top 5,000 on PyPI
ruyamlruyaml is a YAML parser and serializer that…
permissive · top 5,000 on PyPI
nietA command-line tool that extracts and…
permissive · top 15,000 on PyPI
parselParsel extracts data from HTML, JSON, and XML…
permissive · top 5,000 on PyPI
yqyq is a command-line processor that applies jq…
permissive · top 5,000 on PyPI
uipath-coreProvides core abstractions, data models, and…
unclear · top 5,000 on PyPI
pykwalifyValidates YAML and JSON data against schemas…
permissive · top 5,000 on PyPI
pyamlProduces human-readable, diff-friendly YAML…
permissive · top 5,000 on PyPI
shyamlCommand-line tool for querying and extracting…
permissive · top 5,000 on PyPI