Showing revision 11

JSONlab: compact, portable, robust JSON/binary-JSON encoder/decoder for MATLAB/Octave

JSONlab

JSONLab is a free and open-source JSON/UBJSON/MessagePack encoder and decoder written in the native MATLAB language. It can be used to convert a MATLAB data structure (array, struct, cell, struct array, cell array, and objects) into JSON/UBJSON/MessagePack formatted strings and files, or to parse a JSON/UBJSON/MessagePack file into MATLAB data structure. JSONLab supports nearly all versions of MATLAB and GNU Octave (a free MATLAB clone).

The development of JSONLab is currently funded by the US National Institute of Health (NIH) as part of the NeuroJSON project (data portal https://neurojson.io) under grant U24-NS124027. The goal of the NeuroJSON project is to develop scalable, searchable, and reusable neuroimaging data formats and data sharing platforms. All data produced from the NeuroJSON project will be using JSON/Binary JData formats as the underlying serialization standards and the lightweight JData specification as language-independent data annotation standard, all of which have been evolved from the over a decade development of JSONLab.

JSONlab was developed by Qianqian Fang.

Why JSON?

  • JSON is both human and machine readable; it ensures the long-term reusability of the stored data;
  • JSON is universally parsable and has a vast toolchain ecosystem, supporting nearly all programming languages;
  • With modern NoSQL databases, JSON-encoded data can be searched and exchanged in large scale;
  • JSON data are web-friendly as it can be directly invoked (inline or load from remote site) in JavaScript

Share with the community Contribute to JSONlab Documentation and Release Notes Download JSONlab

What's New

  • [2024/03/28]JSONLab v2.9.8 has finally arrived! It gained a number of key features, such as JSONPath for slicing complex JSON data, JSON-mmap for disk-map like fast reading/writing JSON files or streams, downloading/caching externally linked data files (see video tutorial). JSONLab v2.9.8 supports the latest NeuroJSON data specifications.
  • [2021/09/01] We are extremely excited to announce that the JSONLab project, as the official reference library for both JData and BJData specifications, has been funded by the US National Institute of Health (NIH) as part of the NeuroJSON project (https://neurojson.org and https://neurojson.io).
  • [2020/06/15]Nine years in the making,JSONLab 2.0 (Magnus Prime) has arrived! It provides a unified and systematic way to encode complex data and share among applications, thanks to the JData Specification. JSONLab's dependency, zmat toolbox, was also updated to 0.9.8.
  • [2019/10/24] We are excited to announce the arrival of JSONLab 2.0 beta (Magnus). This is perhaps the most significant release since the beginning of the project in 2011. JSONLab v2b supports MessagePack, lzma/lz4/lz4hc, more importantly, as the reference library for JData Specification.
  • [2017/01/02] Happy new year! JSONLab 1.5 is released. The new version contains a 2x speed acceleration for loadjson for large json files and an important bug fix to parse array of heterogeneous elements. From this version, the UBJSON floating point numbers (d/D) also use big-endian format (previously generated UBJSON files must be converted to use with the new version) Please see ChangeLog for details.
  • [2015/12/30] JSONLab 1.2 is released. The new version contains a 2x speed acceleration for savejson and a number of bug fixes. Please see ChangeLog for details. Thanks given to Mykhailo Bratukha, Insik Kim, Sertan Senturk and Oleg Komarov for their patches, suggestions and helpful discussions! Enjoy the new JSONlab and have a Happy New Year!
  • [2015/06/05] JSONLab 1.1 is here, packed with lots of improvement, both bug fixes and speed enhancement. Thanks to those who shared suggestions or reported bugs. The new code is about 20x faster when loading a 150k-small-element JSON file, which is 30% faster than matlab 2015's webread function. Give it a try.
  • [2015/04/24] JSONLab is selected for MATLAB Central's "Pick of the Week". See this nice report from Jiro Doke. Its monthly download now exceeds 500 from MATLAB File Exchange site, with additional downloads from sourceforge.
  • [2015/01/02] Happy New Year! After 3 years of continuous development, here, I proudly announce the arrival of the JSONlab 1.0!. This represents a major milestone towards a fast, lightweight, and versatile JSON/UBJSON processing library in MATLAB/GNU Octave, and an exciting new start for implementing more advanced features and data formats (JMesh/JData). Please take a moment to review the updated documentation, ChangeLog and download your JSONlab 1.0 from here. As always, your feedback is critical. Please share it in our users' mailing list.
  • [2014/11/23] The second release candidate for JSONlab 1.0 has arrived!. This release contains morel bug fixes. It also has a few new features, such as compact JSON output, progress bar support when loading large JSON files etc. Checkout the ChangeLog and update your copy from here.
  • [2014/09/17] Here comes the first release candidate (RC1) of JSONLab 1.0. This release contains several critical bug fixes, including the reverse of integer Endianness of UBJSON data (thanks to Craig Pomeroy), escaping special characters in a JSON string (thanks to Ismail Badawi) and several compatibility issues running JSONLab on GNU Octave. JSONLab 1.0RC1 also includes the support for 2D cell-array and struct-array. !!!Important!!!: If you have previously generated UBJSON binary files on a little-endian system (Intel/AMD processors), please convert them using the new JSONLab to correct the Endianness. To do that, load the old binary data using data=loadubjson(filename,'IntEndian','L'); and then resave the data using saveubjson.
  • [2014/02/02] JSONlab 1.0 Beta is released! In this release, we fixed a few bugs related to saving and loading UBJSON. Please upgrade your jsonlab from this link.
  • [2013/08/23] JSONlab 1.0 Alpha is released! In this release, we added the long-waited Universal Binary JSON support to produce compact binary JSON files, which is potentially useful for many performance-sensitive applications. Please read the ChangeLog and download it from here.
  • [2012/12/18] JSONlab 0.9.1 is a stable release. Thanks to Niclas Borlin's fixes, jsonlab now has much better handling of empty and sparse matrices.
  • [2012/06/20] JSONlab 0.9.0 is here!. It has all the bug fixes and better loadjson-savejson round-trip consistency. Find details in ChangeLogs.
  • [2012/03/05] JSONlab 0.8.1 is ready for download. It features several bug fixes for proper handling of root-less objects and quotation marks. Read ChangeLogs for details.
  • [2012/01/13] JSONlab 0.8.0 (Sentinel) has arrived!. It contains major speed enhancements (20x) to loadjson for processing large data arrays, and several bug fixes. Please see ChangeLogs for more details. Get it from here.
  • [2011/10/21] JSONlab 0.5.1 (Nexus update 1) is available, fixing slow speed of loadjson and support JSON collection (a series of "{...}" enclosed JSON objects in a single file). See ChangeLogs.
  • [2011/10/16] First JSONlab release, 0.5 (Nexus), is ready for download.
  • [2011/10/10] First public announcement of the JSONlab project.
Powered by Habitat