dasel
Select, update, and convert data structures
SYNOPSIS
dasel [flags] command [args]
PARAMETERS
--version
Show application version.
--plain
Disable colored output.
--pretty
Enable pretty output.
-w, --write
Update the input file.
-i, --input-format format
The format of the input, can be: json, yaml, toml, xml, csv, ini, properties.
-o, --output-format format
The format of the output, can be: json, yaml, toml, xml, csv, ini, properties.
get
Gets properties from the given document.
put
Puts a value into the given document.
delete
Deletes a property from the given document.
merge
Merges the contents of given documents into the first document.
DESCRIPTION
dasel is a command-line tool designed for selecting, modifying, and querying data structures stored in various formats such as JSON, YAML, TOML, XML, CSV, and others.
It allows users to extract specific values from structured data, apply transformations, and perform filtering operations without needing to write complex scripts or code.
dasel simplifies the process of working with data from the command line, making it easier to automate tasks, process configuration files, and integrate different data sources. Its intuitive syntax and support for multiple data formats make it a versatile tool for developers, system administrators, and data analysts. It's particularly useful for extracting specific pieces of information from configuration files or APIs where data is formatted in JSON/YAML.
CAVEATS
dasel's XPath support can be limited depending on the XML structure. Complex transformations might require scripting instead. CSV support may require specifying delimiters and header options. Using 'write' is potentially dangerous since data can be lost.
SELECTOR SYNTAX
dasel uses a selector syntax similar to XPath or CSS selectors to identify elements within the data structure.
Selectors can include nested paths, array indices, and wildcard characters.
For JSON/YAML, dots `.` are used to traverse objects. For Arrays the index can be defined like `.[0]`.
DATA TYPE HANDLING
dasel attempts to automatically detect and preserve data types when modifying data.
When setting values, it infers the type from the provided input.
ERROR HANDLING
dasel provides informative error messages when parsing data or executing commands.
It attempts to handle invalid data gracefully, but errors may still occur with malformed inputs.
HISTORY
dasel is a relatively new command-line tool. It aims to provide a more user-friendly and versatile alternative to tools like `jq` and `yq` with support for more data formats. Its development is focused on ease of use and comprehensive data access.