Truns a python object into a JSON structure.

def format(item, **params):
    """Truns a python object into a JSON structure."""
    encoding = params.get('charset', 'UTF-8')
    return json.dumps(item, encoding=encoding)