ecjson
An enhanced/modded version of the cjson package. This package will return the output of _as_javascript function if defined on an object it is serializing to JSON. If it does not exist, it is standard CJSON
Example
class Foo(object):
def _as_javascript():
return "This is my JSON value"