Am 12.07.19 um 19:28 schrieb Sven Schreiber:
Am 12.07.2019 um 18:01 schrieb Artur Tarassow:
> Am 12.07.19 um 17:38 schrieb Riccardo (Jack) Lucchetti:
>>
>> Proof-of-concept:
>
> I would rather favour the json-format as an exchange protocol.
Artur, I think you are in the mainstream in pushing for json to replace
xml, and maybe it's a good push. However, in this specific situation we
got import functions (for the specific xml produced from gretl's bwrite)
for R and Python in essentially zero time. IMHO this proves that there's
no need to switch to json in this particular case. Once you have your
data in the foreign block (R or Python) in a native format, you can do
with it anything you like, including doing json-based stuff.
The "zero"-time argument is a fully valid point. Let's stick to xml as
the main communication format.
> Currently, gretl can read-in json-files and converts them into a
> bundle or array of bundles.
Right, and perhaps json could therefore be the format of choice for the
direction Python -> gretl. Do you think you could write a Python
function that produces something that's readable with gretl's jsongetb?
I guess this is not necessary as the json.dumps() function of the Python
package "json" already converts a dictionary into json format which is
fully readable by gretl's jsongetb():
https://www.w3schools.com/python/python_json.asp
> But there is no way function for writing a bundle's
underlying
> xml-structure in json-format.
I think it would be doable to write a hansl function for this which
could go into the "extra" package.
Yes, this shouldn't be too hard to write given that xml is structured. I
am currently too busy with other projects but can I put it on my list of
todos.
By the way, I really happy that we discuss this here, as extending and
the communication channel with other software projects is a really
useful aspect!
Best,
Artur