JSON Tools

yq – command-line YAML, XML and TOML processor

yq is a command-line processor for querying and transforming YAML, XML and TOML documents using the filtering capabilities of jq. It allows users to apply familiar jq expressions to structured data formats beyond JSON.

The program works by converting documents into a representation that jq can process. The results can then be returned as JSON or converted back into their original format. This makes it useful for inspecting configuration files, extracting individual values and performing automated data transformations.

yq includes separate commands for processing YAML, XML and TOML. Each uses the appropriate parsing libraries while retaining access to jq’s powerful query and manipulation language.

The software is particularly useful for system administrators and developers working with configuration files, infrastructure definitions and structured datasets. It can be incorporated into shell scripts and other automation workflows.

This is free and open source software.

Key Features

  • Processes YAML documents using jq filters and expressions.
  • Provides xq for querying and transforming XML documents.
  • Includes tomlq for processing TOML configuration files.
  • Supports extracting, filtering and transforming structured data.
  • Converts YAML, XML and TOML documents to JSON for processing.
  • Supports conversion back to YAML, XML and TOML where appropriate.
  • Provides in-place editing of supported document formats.
  • Preserves mapping key order when processing YAML documents.
  • Offers round-trip YAML processing that retains custom tags, scalar styles and comments.
  • Supports preservation of TOML comments, whitespace and formatting metadata.
  • Processes YAML frontmatter in Markdown documents while preserving the remaining content.
  • Supports multiple YAML documents within a single input stream.
  • Provides configurable YAML indentation, line wrapping and document markers.
  • Supports streaming large XML documents using configurable item depth.
  • Disables XML entity expansion and DTD resolution to reduce parsing security risks.
  • Preserves jq exit status information for integration with scripts and automated workflows.
  • Cross-platform support – runs on Linux and macOS.

Website: github.com/kislyuk/yq
Support:
Developer: Andrey Kislyuk
License: Apache License 2.0

yq is written in Python. Learn Python with our recommended free books and free tutorials.


Related Software

JSON Tools
jqLightweight and flexible JSON processor. It's like sed for JSON
fxJSON viewer with streaming and mouse support
jaqjq clone focused on correctness, speed, and simplicity.
gronTransforms JSON into discrete assignments to make it easier to grep
gojqPure Go implementation of jq
jlessCommand-line JSON viewer written in Rust
jnvNavigates JSON offering a viewer and filter editor
JSON EditorView, edit, format, and validate JSON
DaselQuery, modify and transform structured data
jidJSON incremental digger by using filtering queries
joSmall utility to create JSON objects
jsonrepairRepair malformed and invalid JSON documents
faqBilled as a more flexible jq supporting additional formats
jelloFilter JSON and JSON Lines data with Python syntax
qqjq but an interoperable configuration format transcoder
json-tuiJSON terminal UI
jqpTUI playground to experiment with jq
emutoSmall language for manipulating and restructuring JSON and other data
svelte-jsoneditorView, edit, format, transform, and validate JSON
qoQuery JSON, CSV, and TSV files using SQL
jqlQuery and process JSON data
JaniceDesktop app for viewing large JSON files
unqeryQuery and transform JSON data
TwigTerminal JSON viewer and YAML viewer
jtcExtract, manipulate and transform source JSON
pyfxPython-native TUI JSON viewer
OTreeInteractive viewer for structured data
kirillJSON validator
jshonParses, reads and creates JSON. It's designed to be as usable as possible
jsawkLike awk, but for JSON
jiqInteractive JSON query tool

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted