Pluggdapps

Component system. Web framework. And more ...

jsonlib – Library functions to parse/generate JSON.

Convert objects from JSON format to python. And vice-versa.

Module contents

pluggdapps.utils.jsonlib.json_encode(value, encoding=None)[source]

JSON-encodes the given Python object. If encoding is supplied, then the resulting json encoded string will be converted to bytes and return the same, otherwise, json encodied string is returned as is.

pluggdapps.utils.jsonlib.json_decode(value, encoding=None)[source]

Convert json encoded value to Python object. If encoding is not supplied value is assumed to be in string, otherwise, value is expected in bytes and converted to string.

Return the python object.