This is a wrapper for the json
module: it will use simplejson if
available, or the json
module from Python >= 2.6 if available, and as a
last resource the django.utils.simplejson
module on App Engine.
It will also escape forward slashes and, by default, output the serialized JSON in a compact format, eliminating white spaces.
Some convenience functions are also available to encode and decode to and from base64 and to quote or unquote the values.
webapp2_extras.json.
encode
(value, *args, **kwargs)[source]¶Serializes a value to JSON.
This comes from Tornado.
Parameters: |
|
---|---|
Returns: | The serialized value. |
webapp2_extras.json.
decode
(value, *args, **kwargs)[source]¶Deserializes a value from JSON.
This comes from Tornado.
Parameters: |
|
---|---|
Returns: | The deserialized value. |
webapp2_extras.json.
b64encode
(value, *args, **kwargs)[source]¶Serializes a value to JSON and encodes it using base64.
Parameters and return value are the same from encode()
.
webapp2_extras.json.
b64decode
(value, *args, **kwargs)[source]¶Decodes a value using base64 and deserializes it from JSON.
Parameters and return value are the same from decode()
.