Skip to content

Releases: dnl-blkv/alcdef2json

ALCDEF 2.0 to JSON converter

11 Dec 23:55
Compare
Choose a tag to compare

Meet the first ever version of ALCDEF 2.0 to JSON converter.

The main conversion points are as follows:

  • All JSON keys are similar to ALCDEF field names, but in lower case.
  • Boolean strings from ALCDEF are represented as booleans in JSON.
  • String values from ALCDEF are partially escaped in JSON to comply with MongoDB export requirements: MongoDB compatibility was a requirement in development of the very first ALCDEF to JSON converter version. Commas are replaced with dots.
  • Double strings from ALCDEF including the Julian Date are represented as doubles in JSON.
  • There are two modes of data blocks conversion available: the flat mode and the nested mode. The difference between the two is as follows:
    • In the flat mode, data entries are suffixed with their index numbers.
    • In the nested mode, data entries are put into arrays, each element of such
      arrays being an object with subfields of data represented as key-value pairs.

Flags

The v1.0.0 version works with the following flags:

  • --from - required, with a single argument; the argument defines the
    address of the source ALCDEF file, or directory with such files.
  • --to - required, with a single argument; the argument defines the address
    of the resulting JSON file, or directory for such files; the output files
    (but not directories!) are created automatically if not exist.
  • --flat - optional, with no arguments; defines the flat operation mode
    (the choices are flat and nested); default choice is nested