dts
A simple tool to deserialize data from an input encoding, transform it and serialize it back into an output encoding.
Uses jq for data transformation and
requires rust >= 1.56.0.
Installation
Check out the releases page
for prebuilt versions of dts.
Statically-linked binaries are also available: look for archives with musl in
the filename.
From crates.io
From source
Clone the repository and run:
Usage
For a full list of available flags consult the help:
Examples
Convert YAML to TOML:
Load all YAML files from sub directories and merge them into one:
Transform the input data using a jq expression:
Use jq filter expression from a file:
Read data from stdin:
|
Output colors and themes
dts supports output coloring and syntax highlighting. The coloring behaviour
can be controlled via the --color flag or DTS_COLOR environment variable.
If the default theme used for syntax highlighting does not suit you, you can
change it via the --theme flag or DTS_THEME environment variable.
Available themes can be listed via:
Hint: The color feature can be disabled at compile time if you don't want
to have colors at all. See the Cargo feature section below.
Supported Encodings
Right now dts supports the following encodings:
- JSON
- YAML
- TOML
- JSON5 (deserialize only)
- CSV
- QueryString
- XML
- Text
- Gron
- HCL (deserialize only)
Cargo features
Support for colored output is provided by the color feature which is enabled
by default. The feature increases binary size and may be disabled via:
If you just want to disable colors by default with the option to enable them
conditionally, you can also set the NO_COLOR
environment variable or set DTS_COLOR=never.
License
The source code of dts is released under the MIT License. See the bundled LICENSE file for details.