Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lucascompython/dsc

A blazingly fast Data Serialization Language Convertor
https://github.com/lucascompython/dsc

blazingly-fast cli json rust serde toml tool xml yaml

Last synced: about 1 month ago
JSON representation

A blazingly fast Data Serialization Language Convertor

Awesome Lists containing this project

README

        

# dsc (Data Serialization Language Converter)

This is a `blazingly fast` tool that converts data from one format to another .
It uses [serde](https://crates.io/crates/serde), [serde_json](https://crates.io/crates/serde_json), [serde_yaml](https://crates.io/crates/serde_yaml), [toml](https://crates.io/crates/toml) and [quick-xml](https://crates.io/crates/quick-xml) to do the heavy lifting.
Null values are not supported in toml, at least for now.

## Examples

```ps1
dsc --help # to see all the options
```

Reading from stdin and writing to a file:

```ps1
cat input.json | dsc --from json out.yaml # target format is inferred from the file extension
```

Writing to stdout and reading from a file:

```ps1
dsc input.toml --to xml > out.xml # source format is inferred from the file extension
```

Reading from stdin and writing to stdout:

```ps1
# here both formats need to be explicitly specified because there are no file extensions
curl -s https://api.github.com/users/lucascompython | dsc --from json --to yaml | cat
```

Reading from a file and writing to another file:

```ps1
# the -o flags enables whitespace removal and the -r flag sets the root tag for xml
dsc input.toml out.xml -r roottag -o # formats are inferred from the file extensions
```