json_loads

compas.json_loads(s)[source]

Read COMPAS object data from a JSON string.

Parameters

s (str) – A JSON data string.

Returns

data – 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()
>>> data1 == data2
True