director.thirdparty.numpyjsoncoder module

class director.thirdparty.numpyjsoncoder.NumpyConvertEncoder(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, encoding='utf-8', default=None)[source]

Bases: json.encoder.JSONEncoder

default(obj)[source]

if input object is a ndarray it will be converted to a Python list with ndarray.tolist

director.thirdparty.numpyjsoncoder.NumpyDecoder(dct)[source]

Decodes a previously encoded numpy ndarray with proper shape and dtype :param dct: (dict) json encoded ndarray :return: (ndarray) if input was an encoded ndarray

class director.thirdparty.numpyjsoncoder.NumpyEncoder(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, encoding='utf-8', default=None)[source]

Bases: json.encoder.JSONEncoder

default(obj)[source]

if input object is a ndarray it will be converted into a dict holding dtype, shape and the data base64 encoded

director.thirdparty.numpyjsoncoder.decode(dataStream)[source]
director.thirdparty.numpyjsoncoder.encode(dataObj)[source]