Blacksmoke16 / oq

A performant, and portable jq wrapper to facilitate the consumption and output of formats other than JSON; using jq filters to transform the data.
https://blacksmoke16.github.io/oq/
MIT License
190 stars 15 forks source link

[Feature request]: Add toml format #113

Open joshcangit opened 1 year ago

joshcangit commented 1 year ago

Would be nice to add toml format.

Blacksmoke16 commented 1 year ago

First would need to get https://github.com/crystal-community/toml.cr updated to latest version of the spec I would say.

wstein commented 1 year ago

What about using syeopite/ctoml-cr? This project provides Crystal bindings to the cktan/tomlc99 library. Compliant to TOML v1.0.0.

Blacksmoke16 commented 1 year ago

@wstein Mainly didn't want to deal with needing to link to an external lib. It does look like it can link statically but a pure Crystal implementation would still be easier to work with.

Either way, the lib needs to also support generating TOML, which neither of them support at the moment.

wstein commented 1 year ago

Indeed pure crystal would be nice.

The second argument about generating TOML is from my perspective not that important. I seenTOML in first place for human to machine 'communication'. There are better formats for machine to machine and machine to human communication.

Blacksmoke16 commented 1 year ago

It depends on how @joshcangit wanted to use this feature. Part of oq is being able to go to/from any of the supported formats. If all they want to do is consume TOML and output JSON or something then we could save TOML serialization for later given deserialization would be quite a bit easier.

Otherwise TOML generation would be required so you can do the full loop of TOML => JSON => TOML.