json_loads

compas.data.json_loads(s)[source]

Read COMPAS object data from a JSON string.

Parameters

s (str) – A JSON data string.

Returns

obj – The (COMPAS) data contained in the string.

Examples

>>> import compas
>>> from compas.geometry import Point, Vector
>>> data1 = [Point(0, 0, 0), Vector(0, 0, 0)]
>>> s = compas.json_dumps(data1)
>>> data2 = compas.json_loads(s)
>>> data1 == data2
True