DMelt:IO/6 EDN File Format
EDN file format
DataMelt includes library to handle extensible data notation format. The EDN format is described in EDN web page. The included implementation is based on the edn-java gitlab. The Java API can be found in us.bpsm.edn.parser.package-summary.
The EDN files can hold any Java and Python object in a form of simple text files. The files are typically smaller then similar XML files since no tags is used. This feature make EDM files attractive to keep numeric data.
For example, Java ArrayList or Python list will be written to the text file exactly it should look:
You can also write lists, maps (dictionaries) to external files in arbitrary order. Then you can read such text files back, creating Java lists (Python lists) on the fly.
This is an example of parsing EDN string messages:
This is an example:
|Protected code example! Request membership or login to this member link first.|
Now let us consider a complete example: We create Java list, Python list, Java map, Python dictionary, fill them and write all these objects sequentially into a file. Then we read the encoded objects back, creating on the fly lists, maps and dictionaries:
|No access to this part. Use Member area to request membership. If you are already a member, login to Member area and come back to this wiki.|
You can use this class to help with parsing the file:
pbr = Parsers.newParseable(IOUtil.stringFromResource("us/bpsm/edn/edn-sample.txt"))
Read this using us.bpsm.edn.parser.IOUtil API.