as_pure_json() function

yggdrasil_rapidjson.as_pure_json(json)

Convert a JSON document containing yggdrasil extension values to pure JSON. This can result in the loss of information that cannot be expressed in pure JSON (e.g. units, value precision, complex numbers)

Parameters:

as_pure_json (str, dict) – JSON document to convert to a pure JSON instance

Returns:

Converted docuemnt.

>>> as_pure_json(3.2+4.1j)
[3.2, 4.1]
>>> as_pure_json(units.Quantity(5, 'cm'))
5
>>> import numpy as np
>>> as_pure_json(np.arange(4))
[0, 1, 2, 3]