def compress ( obj ) : return json . dumps ( obj , sort_keys = True , separators = ( ',' , ':' ) , cls = CustomEncoder )
python dump json with custom encoder
Outputs json without whitespace .
def compress(obj):
    """Outputs json without whitespace."""
    return json.dumps(obj, sort_keys=True, separators=(',', ':'),
                      cls=CustomEncoder)