TomWright

dasel: Query and Transform Structured Data

Dasel is a Go command-line tool and library for querying, editing, and converting structured data across formats such as JSON, YAML, TOML, XML, and CSV. Its shared selector syntax suits shell workflows and Go applications that handle multiple configuration formats.

Stars
8k
Forks
174
Stars, last 16 days
+6

Our take

Health score

53/100

How it is scored
Activity
60
Community
44
Issues
47
Pull requests
61

+6 stars in the last 16 days

  • Releases more often than 79% of the projects we track

Overview

Dasel provides one way to select, update, and transform data across several structured formats. It addresses the friction of using different tools or query syntax for each format, and can also convert data between supported formats.

It is aimed at developers, DevOps practitioners, and data-wrangling workflows. Use it from a shell pipeline for quick file operations, or import it as a Go library when format-aware data handling is part of an application.

Key Features

  • Query JSON, YAML, TOML, XML, INI, HCL, KDL, and CSV using a unified selector syntax.
  • Select values and structures, including through nested data with recursive descent.
  • Search structures for values matching a condition.
  • Update, insert, or delete values in structured data.
  • Convert input between supported formats, such as JSON to YAML.
  • Use the command-line interface in scripts and pipelines, or integrate the Go library into projects.
  • Generate shell completions for Bash, Zsh, Fish, and PowerShell.

Use Cases

  • DevOps teams can extract or update configuration values in shell scripts without switching tools for each file format.
  • Developers can convert configuration or data files between formats as part of a build or migration workflow.
  • Data-wrangling tasks can use selectors and searches to locate nested values across structured documents.
  • Go developers can use the library to query or modify supported data formats within an application.

Getting Started

Install with Homebrew:

brew install dasel

For usage and other installation options, see the README and documentation.

Considerations

  • Selectors are shared across formats, but the data formats themselves have different structures and conventions. Check the documentation for format-specific behavior.
  • The README documents both command-line and Go library use. Choose the integration that fits your workflow.
  • The project is not archived and is released under the MIT License.

Found this useful?

Share it with someone who would like dasel.