gluonts.json module#

This modules wraps json libraries, namely usjons and orjson ans defaults to just json if none of the others is installed. The idea is to use a high performance variant, if available.

We expose the normal json functions dump, dumps, load and loads.

In addition, we define bdump and bdumps, which emit byte instead of str.

Both dump and bdump expose a nl interpreter, which appends a newline character if set to True.

gluonts.json.bdump(obj, fp, nl=False)#
gluonts.json.bdumps(obj, /, default=None, option=None)#

Serialize Python objects to JSON.

gluonts.json.dump(obj, fp, nl=False)#
gluonts.json.dumps(obj)#
gluonts.json.load(fp)#
gluonts.json.loads(obj, /)#

Deserialize JSON to Python objects.