class URL(object):
    """encode/decode requested URL"""

def __init__(self):
    self.charset = (
        '/abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789.')

def encode(self, url):
    return ''.join([(c if c in self.charset else '%' + c.encode('hex').
        upper()) for c in url])

def decode(self, url):
    return re.compile('%([0-9a-fA-F]{2})', re.M).sub(lambda m: chr(int(m.
        group(1), 16)), url)
Как декодировать encodeURIComponent в GAE (python)?