2022-09-17 20:29:35 +02:00
# Description
This tool "traduit" (french for translate) data formats. It was made in the hope to bring serde to the cli (serdi ^^). But that not exaclty what serde is about and I have no affiliation with them so I did not want to namesquat.
# Installation
First install [the rust toolchain ](https://www.rust-lang.org/tools/install ) and then execute the following command:
```sh
cargo install tradaf
```
# Usage example
Prettify (or minify) some data format for ease of reading (resp: compact and have less data to save/transfert)
```sh
2024-12-22 21:09:55 +01:00
tradaf json json --pretty < test-data / simple . json
2022-09-17 20:29:35 +02:00
```
Litterally transcode between data formats
```sh
2024-12-22 21:09:55 +01:00
tradaf ron yaml < test-data / standard . ron
2022-09-17 20:29:35 +02:00
```
Transcode into JSON so we can use `jq` , do some transformations and then transcode again into another format for viewing
```sh
2024-12-22 21:09:55 +01:00
tradaf RON json < test-data / gameConfig . ron | jq . key_bindings | tradaf Json yaml
2022-09-17 20:29:35 +02:00
```
2022-10-26 23:56:41 +02:00
# TODOS
* [ ] Implement all [data formats ](https://serde.rs/#data-formats ), or at least the one that expose a serde serializer or deserializer.
2022-12-04 14:24:05 +01:00
* [-] Bencode
* [X] Deserialization
* [ ] Serialization
2022-10-26 23:56:41 +02:00
* [ ] BSON
* [ ] CBOR
2022-10-29 20:33:38 +02:00
* [-] DBus (not sure it is working, but it compile…)
2022-12-04 14:24:05 +01:00
* [ ] DynamoDB
2022-10-26 23:56:41 +02:00
* [ ] Envy (deserialization only)
* [ ] Envy store (deserialization only)
2022-10-29 20:33:38 +02:00
* [ ] FlexBuffer
* The `Serializer` and `Deserializer` exposed does not work with serde-transcode.
* [-] GVariant => See DBus: the same crate propose both
2022-12-04 14:24:05 +01:00
* [ ] HJSON
2022-10-26 23:56:41 +02:00
* [X] JSON
2022-10-29 20:33:38 +02:00
* [-] JSON5
2022-10-26 23:56:41 +02:00
* [X] Deserialization
* [ ] Serialization
2022-10-29 20:33:38 +02:00
* [ ] https://github.com/Lucretiel/kaydle
* [ ] S-Expressions (lisp)
2022-10-26 23:56:41 +02:00
* [X] Pickle
* [ ] Test properly both way
2022-10-29 20:33:38 +02:00
* [-] Query String (URL)
2022-10-26 23:56:41 +02:00
* [ ] Deserialization
* [X] Serialization
2022-10-29 20:33:38 +02:00
* [-] MessagePack
2022-10-26 23:56:41 +02:00
* [ ] Deserialization
* [X] Serialization
* [X] RON
* [ ] TOML
* [X] YAML
* [ ] …
* [ ] Add tests for each serializer and each deserializer (at least one)
* [ ] Check if crates have features that we should enable/disable
* [ ] `zvariant` looks to include async runtime by default
* [ ] Check my notes for each data format and open an issue on the crates to point problem/present my project and ask for help
2024-12-22 21:09:55 +01:00
* [ ] Check if other data format have pretty formatting available
2022-10-26 23:56:41 +02:00
* [ ] Add proper error handling (find a mentor to explain me propper error management: struct, enum, … and then use anyhow/this_error if needed)
2024-12-22 21:09:55 +01:00
* [ ] Transform any script idea into an xtask