m2c: an automatic transposition tool in the hands of final users [with regarding to the original datas], which may have poor or any knowledge of structure, meaning and trustness of the queried data looks unsafe to me. CSV output should be arranged and provided from data owner in parallel to any other data format like Json.

On Sun, 28 Jul 2019 at 14:47, Chris Mair <chris@1006.org> wrote:
>> If you post what you want to extract from a sample outpust, I can
>> provide some
>> code as an example. If somebody else does the same with JQ we can
>> compare the
>> solutions.
> I have no specific output in mind. Just playing and investigating a little bit.
> The dream would be to create a general converter function, which creates a flat csv over any json. A function which takes any json as input and produces a flat csv as output.
> Often non technical Data Consumers of Open Data Hub ask for a CVS version, because using the json api is too complicated for them. In this cases a generic converter would be very helpful.
> Patrick


I understand that people want to see data in spreadsheets.

But you still need to provide some logic (be it code or a JQ expression or whatever)
to map your *particular* scheme into a CSV...

Something general like anyjsondata.toCSV() can be done but likely will do some tree
trasversal that doesn't really give practical output for non-trivial nested data
structures such as the response of /api/Accommodation.

Of course if the JSON is just an array of hashmaps with all scalar values then anything
will work fine :)