http://code.google.com/apis/maps/documentation/webservices/index.html#PythonSignatureExample

def _generate_signature(self, base_url, private_key):
        """
        http://code.google.com/apis/maps/documentation/webservices/index.html#PythonSignatureExample
        """
        url = urlparse.urlparse(base_url)
        url_to_sign = url.path + '?' + url.query
        decoded_key = base64.urlsafe_b64decode(private_key)
        signature = hmac.new(decoded_key, url_to_sign, hashlib.sha1)
        return base64.urlsafe_b64encode(signature.digest())